DB

Key/Value store backed by LevelDB.

var DB = require("DB");
var db = new DB("mydb_base");
db.set("foo", "bar");
console.log(db.get("foo"));

new DB()

Open a database

You cannot open more than once the same DB.

close()

Force the database to be closed

The DB instance will automatically be closed when the DB instance is GCed.

delete()

Delete a key from the DB.

drop()

Drop the database (delete it).

get(key=F)

Get the value for a key.

Arguments:
key (String)

the key to get

Returns: Any

value

set(key=F, value=F)

Set the value for a key.

Arguments:
key (String)

the key to set

value (Any)

the value to set


Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!