Socket
Socket
Sign inDemoInstall

lmdb

Package Overview
Dependencies
1
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0 to 0.0.1

.jshintrc

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"
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc