Nightingale Posing Mischievously
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

level-defaults

0.1.0 • Public • Published

level-defaults Build Status

Adds a defaults() method to your LevelUp.

Install the module with: npm install level-defaults --save

var levelup = require('levelup');
var levelDefaults = require('level-defaults');
 
var db = levelup('/tmp/foo.db');
db = levelDefaults(db);
 
db.defaults({
  user: 'shama',
  pass: '1234',
}, {
  homepage: 'http://dontkry.com'
}, function(err, data) {
  // data = {user: 'shama', pass: '1234', homepage: 'http://dontkry.com'}
});
 
// ... later ...
 
db.defaults({
  user: null,
  pass: null
}, function(err, data) {
  // data = {user: 'shama', pass: '1234'}
});

Release History

  • 0.1.0 - initial release

License

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.

Keywords

none

install

npm i level-defaults

Downloadsweekly downloads

4

version

0.1.0

license

none

repository

githubgithub

last publish

collaborators

  • avatar