2.2.0 • Published 9 years ago

level-wrangler v2.2.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

level-wrangler Build Status Dependency Status

Defines and stores json models by indices within a leveldb

npm i -S level-wrangler

Example

var level = require( 'level-party' )( '/tmp/.db' );
var sub = require( 'level-sublevel' )( level );
var db = require( 'level-wrangler' )( sub.sublevel( 'users', {
    encoding: 'json'
}));

var users = db.createFactory( 'users', {} );

Finding stuff

users.findAll()
    .then( res => {
        streamify( res.map( user => {
            return user.name
        }) ).pipe( process.stdout );
    })
    .catch( ... );

Hiding Storing stuff

var user = users.create({
    username: 'Jack',
    password: 'wr4angl1ng'
});

user.save();

Getting rid of stuff

user.remove()
    .then( ... )
    .catch( ... )

Check out the test suite for more use examples.

Contributing

npm run watch

Test it up

npm test

V2 Goals

  • non-intrusive-wrangler, give it a level instance with whatever plugins you want.
  • minimal model-schema that allows indexable props
  • Pluggable—stuff like validation should be an extended module
  • ES6 and babel—yuuup
2.2.0

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

2.0.0-rc

9 years ago

0.5.0

9 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.1.0

10 years ago