ls

level-set

Saves JSON to your LevelDB

Showing:

Popularity

Downloads/wk

3

GitHub Stars

3

Maintenance

Last Commit

8yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

level-set

Saves JSON to your LevelDB. Converting your JSON to LevelDB key-value pair data structure.

Install

npm install level-set
var LevelUp = require('levelup'),
    LevelSet = require('level-set');

var db = LevelUp('./testdb');

LevelSet(db);

Set JSON object

var person = { name: 'Maiah', occupation: 'Ninja' };
db.set('/', person, function (err) {
  if (!err) console.log('Saved person under root path');
});

This will put key-value pairs LevelDB data structure at the root path.

name = Maiah
occupation = Ninja

You can also save any valid JSON structure.

var person = {
  name: 'Maiah',
  occupation: 'Ninja',
  tools: {
    lang: 'js'
  }
};

db.set('/', person, function (err) {
  if (!err) console.log('Saved person under root path');
});

This will put key-value pairs LevelDB data structure at the root path.

name = Maiah
occupation = Ninja
tools/lang = js

You can also specify a path other than the root.

var person = { name: 'Maiah', occupation: 'Ninja' };
db.set('/person', person, function (err) {
  if (!err) console.log('Saved person object');
});

This will put key-value pairs LevelDB data structure at the person path.

person/name = Maiah
person/occupation = Ninja

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial