simple-json-data
v1.0.0
Published
A simple json data store.
Readme
Introduce
A simple json data store.
Install
npm install simple-json-dataHow to use
import { SimpleJsonData } from 'simple-json-data';
const instance = new SimpleJsonData(
'./demo-data.json',
{
idU: {
default: '',
},
content: {
default: '',
},
},
{
idKey: 'id__local__',
},
);
async function start() {
console.log(instance);
await instance.init();
console.log(instance.list());
instance.add({
id: 123123,
content: '456123',
});
await instance.save();
// instance.find(()=>true);
// instance.filter(()=>true);
// instance.count();
// instance.shift();
// instance.pop();
// instance.setList([]);
// instance.update({id__local__:'123});
// instance.delete({id__local__:'123});
}
start();