json-datastore
File-based JSON datastore.
Install
$ npm install --save json-datastore
Usage
let datastore =// Write to a datastoredatastore// Write to users collectiondatastore// Read by id in users collectiondatastore// Read all in users collectiondatastore// Read all in users collection in descending orderdatastore// Remove all in users collectiondatastore
API
datastore.read(path, query, options)
Read one or many documents in the specified path.
datastore.write(path, object, options)
Write object to a JSON file in the specified path. An _id
is generated by default for the object and used as the file name. You can partition the store by writing to sub-directories.
datastore.remove(path, query)
Remove one or many documents in the specified path.