mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
401 B
TypeScript
17 lines
401 B
TypeScript
import Lowdb = require('lowdb');
|
|
|
|
const db = new Lowdb('db.json');
|
|
|
|
db.defaults({ someObject: {}, anotherObject: {} }).write();
|
|
|
|
db.get('someObject').set('foo' , 'bar').write();
|
|
db.get('someObject.foo').value();
|
|
|
|
db.get('anotherObject').set('foo' , 'bar').write();
|
|
db.get('anotherObject.foo').value();
|
|
|
|
db.set('singleValue', 'foo').write();
|
|
db.get('singleValue').value();
|
|
|
|
console.log(db.getState());
|