Comparing version
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 (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
527381
16453.08%1
-66.67%63
1160%273
1037.5%3
200%1
Infinity%2
Infinity%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed