lmdb
Advanced tools
Comparing version 0.0.0 to 0.0.1
21
lmdb.js
@@ -1,20 +0,1 @@ | ||
const levelup = require('levelup') | ||
, MemDOWN = require('memdown') | ||
, xtend = require('xtend') | ||
function factory (location) { | ||
return new MemDOWN(location) | ||
} | ||
function lmdb (location, options, callback) { | ||
if (typeof options != 'object') { | ||
callback = options | ||
options = {} | ||
} | ||
options.db = factory | ||
return levelup(location, options, callback) | ||
} | ||
module.exports = lmdb | ||
module.exports = require('bindings')('nlmdb.node').nlmdb |
@@ -9,11 +9,11 @@ { | ||
] | ||
, "version" : "0.0.0" | ||
, "version" : "0.0.1" | ||
, "main" : "lmdb.js" | ||
, "dependencies" : { | ||
"memdown" : "~0.2.0" | ||
, "levelup" : "~0.9.0" | ||
, "xtend" : "~2.0.4" | ||
"bindings" : "~1.1.0" | ||
} | ||
, "devDependencies" : { | ||
"tape" : "*" | ||
"tap" : "*" | ||
, "rimraf" : "*" | ||
, "abstract-leveldown" : "*" | ||
} | ||
@@ -25,5 +25,5 @@ , "repository" : { | ||
, "scripts" : { | ||
"test" : "node ./test.js" | ||
"test" : "tap ./test.js test/*-test.js --stderr" | ||
} | ||
, "license" : "MIT" | ||
} |
33
test.js
@@ -1,13 +0,28 @@ | ||
const tape = require('tape') | ||
const test = require('tap').test | ||
, lmdb = require('./') | ||
tape('lmdb', function (t) { | ||
t.plan(1) | ||
var db = lmdb('blerg') | ||
db.put('foo', 'bar') | ||
db.get('foo', function (err, value) { | ||
t.equal(value, 'bar', 'correct value') | ||
t.end() | ||
test('lmdb', function (t) { | ||
var db = lmdb('./blerg') | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
db.put('foo', 'bar', function (err) { | ||
t.notOk(err, 'no error') | ||
db.get('foo', { asBuffer: false }, function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.equal(value, 'bar', 'correct value') | ||
db.del('foo', function (err) { | ||
t.notOk(err, 'no error') | ||
db.get('foo', { asBuffer: false }, function (err, value) { | ||
t.ok(err, 'no value') | ||
t.ok(/MDB_NOTFOUND:/.test(err.toString()), 'correct error') | ||
t.notOk(value, 'no value') | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.end() | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
527381
1
63
273
3
1
2
+ Addedbindings@~1.1.0
+ Addedbindings@1.1.1(transitive)
- Removedlevelup@~0.9.0
- Removedmemdown@~0.2.0
- Removedxtend@~2.0.4
- Removedabstract-leveldown@0.7.4(transitive)
- Removedconcat-stream@0.1.1(transitive)
- Removederrno@0.0.5(transitive)
- Removedforeach@2.0.6(transitive)
- Removedindexof@0.0.1(transitive)
- Removedis@0.2.7(transitive)
- Removedis-object@0.1.2(transitive)
- Removedlevelup@0.9.0(transitive)
- Removedmemdown@0.2.1(transitive)
- Removedobject-keys@0.2.0(transitive)
- Removedprr@0.0.0(transitive)
- Removedsemver@1.1.4(transitive)
- Removedsimple-bufferstream@0.0.4(transitive)
- Removedxtend@2.0.6(transitive)