quick-store
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/quick-store package

0.1.4 • Public • Published

quick-store

Quick JSON storage for NodeJS server, using localStorage syntax with a few added. Async.

var db = require('quick-store')();                // saved file ./db.json
var db = require('quick-store')('./mydb.json');   // saved file ./mydb.json

db.setItem('key', 'value', function(o){
   // {key: 'value'}
})

db.getItem('key', function(v){
   // v === value
})

db.removeItem('key', function(v){
   // {}
})

db.put({key2: 'val2'}, function(){
   // put entire object to file
})

db.get(function(o){
   // get entire object
})

db.clear(function(){
  //  {}
}

db.change('./newdb.json'); 
// use a new file

Readme

Keywords

none

Package Sidebar

Install

npm i quick-store

Weekly Downloads

7

Version

0.1.4

License

none

Last publish

Collaborators

  • dpweb