var db = require('node-localdb');
var user = db('path/to/user.json');
user.insert({username: 'jf', password: '123', email: '123@qq.com'}).then(function(u){
console.log(u);
});
user.findOne({}).then(function(u){
console.log(u);
});
user.findOne({username: 'xx'}).then(function(u){
console.log(u);
});
user.find({}).then(function(us){
console.log(us.length);
console.log(us);
});
user.find({}, {limit: 10, skip: 10 * 2}).then(function(us){
console.log(us);
});
user.count({}).then(function(count){
console.log(count);
});
user.remove({username: 'jf'}).then(function(u){
console.log(u);
});