{"name":"memdown","description":"An drop-in replacement for LevelDOWN that works in memory only","version":"3.0.0","homepage":"https://github.com/Level/memdown","authors":["Rod Vagg <rod@vagg.org> (https://github.com/rvagg)"],"contributors":[{"name":"Julian Gruber","email":"julian@juliangruber.com","url":"https://github.com/juliangruber"}],"keywords":["leveldb","leveldown","levelup","memory"],"main":"memdown.js","repository":{"type":"git","url":"git+https://github.com/Level/memdown.git"},"dependencies":{"abstract-leveldown":"~5.0.0","functional-red-black-tree":"~1.0.1","immediate":"~3.2.3","inherits":"~2.0.1","ltgt":"~2.2.0","safe-buffer":"~5.1.1"},"devDependencies":{"airtap":"^0.0.5","faucet":"^0.0.1","istanbul":"^0.4.2","istanbul-coveralls":"^1.0.3","rimraf":"^2.6.2","standard":"^11.0.0","tape":"^4.8.0"},"browser":{"./immediate.js":"./immediate-browser.js"},"scripts":{"test":"standard && node test.js | faucet","test-browsers":"airtap --sauce-connect --loopback airtap.local --no-coverage test.js","test-browser-local":"airtap --no-coverage --local 9000 test.js","coverage":"istanbul cover -i memdown.js ./node_modules/.bin/tape ./test.js && istanbul check-coverage --lines 90 --function 80 --statements 90 --branches 80","report-coverage":"npm run coverage && istanbul-coveralls"},"license":"MIT","engines":{"node":">=6"},"files":["memdown.js","immediate.js","immediate-browser.js","UPGRADING.md"],"gitHead":"ee4602b570dc2461f476f3d19b9090d062f5d3a5","bugs":{"url":"https://github.com/Level/memdown/issues"},"_id":"memdown@3.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"email":"julian@juliangruber.com","name":"juliangruber"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"},{"email":"nolan@nolanlawson.com","name":"nolanlawson"},{"email":"ralphtheninja@riseup.net","name":"ralphtheninja"},{"email":"r@va.gg","name":"rvagg"},{"email":"dev@vincentweevers.nl","name":"vweevers"}],"dist":{"integrity":"sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==","shasum":"93aca055d743b20efc37492e9e399784f2958309","tarball":"http://registry-npm.ywwl.com/memdown/download/memdown-3.0.0.tgz","fileCount":8,"unpackedSize":17066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBHBvCRA9TVsSAnZWagAA1xcP/jh3tNqp37Kps6pjjySi\n+aAo6dq/dCo/CHcP18tCFl86dTcUbEyR3K05U/TQXfikagUGZy8XHRE0lxl9\nv1fqopqnlGhSJAcAUq5v6705EG5MOk+LxUSnEIsF4kb01dDZLQYrs4jMclzp\n1qWKK4tz8DdsODl28dHOSyn4pzYC4gnfY8SG3bQMHPdtIN5ullpd1Wrl4+tD\nsWhpUZ4QjKVw/XBdoO7XFdqsstJOxxB20l3aTIO13EAI0+3ve9GoGwxQCKcK\nYCfsExoCn7OZL4L02MS6RpC1wTGCq08Pe39szFTLBj/3mvis8/505wXzXS4F\n64eXAZ+F5Yr1D3mKDdEoWq5HgPwPMTUgHg/IlKhEyUTELOmIlN6VUFE5LZaK\nYNC+he2Hjwe53Plwpas5lcfj4uqHwhaAik4fP7CHabeLPdLw5k7A1aowt3Zt\ntUHcluI995tpGHim7cRLAyVXYMDdYcuHMb+tX/+RM8I7Erkvv4WBw76PwJUU\n1r6ZA1htoquY458L1u+1h4ieMymIPgEjzjSlK9EnNN6mU22+YehBA1rkfK4w\nMWmmt4/KmHSqqJN3ElGBnHKMfqHuXhnRtAhHDpZHse42kriW1TQsjpgTAIut\n0UJyn+Me1wPwNupvXMvooYuD0MptiwC0bJdgL38kabnYDHMRZ/bFyf7hXa/O\ncnZU\r\n=b/Or\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBONt19WmkuL5B7bgCr0xLpUKMw1/l78MDp0GYpVirxAiEA8OdFsEKzxq8rpniMI4J//vMG6erovTXF/igBJ/6kHAA="}],"size":6068,"noattachment":false,"key":"/memdown/-/memdown-3.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memdown_3.0.0_1527017582606_0.014340328599157681"},"_hasShrinkwrap":false,"readme":"# memdown\n\n> In-memory [`abstract-leveldown`] store for Node.js and browsers.\n\n[![level badge][level-badge]](https://github.com/Level/awesome)\n[![npm](https://img.shields.io/npm/v/memdown.svg)](https://www.npmjs.com/package/memdown)\n[![Node version](https://img.shields.io/node/v/memdown.svg)](https://www.npmjs.com/package/memdown)\n[![Test](https://img.shields.io/github/workflow/status/Level/memdown/Test?label=test)](https://github.com/Level/memdown/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/memdown?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/memdown)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\n[![Donate](https://img.shields.io/badge/donate-orange?logo=open-collective&logoColor=fff)](https://opencollective.com/level)\n\n## Example\n\n_If you are upgrading: please see [`UPGRADING.md`](./UPGRADING.md)._\n\n```js\nconst levelup = require('levelup')\nconst memdown = require('memdown')\n\nconst db = levelup(memdown())\n\ndb.put('hey', 'you', (err) => {\n  if (err) throw err\n\n  db.get('hey', { asBuffer: false }, (err, value) => {\n    if (err) throw err\n    console.log(value) // 'you'\n  })\n})\n```\n\nWith `async/await`:\n\n```js\nawait db.put('hey', 'you')\nconst value = await db.get('hey', { asBuffer: false })\n```\n\nYour data is discarded when the process ends or you release a reference to the store. Note as well, though the internals of `memdown` operate synchronously - [`levelup`] does not.\n\n## Browser support\n\n[![Sauce Test Status](https://app.saucelabs.com/browser-matrix/level-ci.svg)](https://app.saucelabs.com/u/level-ci)\n\n## Data types\n\nKeys and values can be strings or Buffers. Any other key type will be irreversibly stringified. The only exceptions are `null` and `undefined`. Keys and values of that type are rejected.\n\n```js\nconst db = levelup(memdown())\n\ndb.put('example', 123, (err) => {\n  if (err) throw err\n\n  db.createReadStream({\n    keyAsBuffer: false,\n    valueAsBuffer: false\n  }).on('data', (entry) => {\n    console.log(typeof entry.key) // 'string'\n    console.log(typeof entry.value) // 'string'\n  })\n})\n```\n\nIf you desire non-destructive encoding (e.g. to store and retrieve numbers as-is), wrap `memdown` with [`encoding-down`]. Alternatively install [`level-mem`] which conveniently bundles [`levelup`], `memdown` and [`encoding-down`]. Such an approach is also recommended if you want to achieve universal (isomorphic) behavior. For example, you could have [`leveldown`] in a backend and `memdown` in the frontend.\n\n```js\nconst encode = require('encoding-down')\nconst db = levelup(encode(memdown(), { valueEncoding: 'json' }))\n\ndb.put('example', 123, (err) => {\n  if (err) throw err\n\n  db.createReadStream({\n    keyAsBuffer: false,\n    valueAsBuffer: false\n  }).on('data', (entry) => {\n    console.log(typeof entry.key) // 'string'\n    console.log(typeof entry.value) // 'number'\n  })\n})\n```\n\n## Snapshot guarantees\n\nA `memdown` store is backed by [a fully persistent data structure](https://www.npmjs.com/package/functional-red-black-tree) and thus has snapshot guarantees. Meaning that reads operate on a snapshot in time, unaffected by simultaneous writes.\n\n## Test\n\nIn addition to the regular `npm test`, you can test `memdown` in a browser of choice with:\n\n```\nnpm run test-browser-local\n```\n\nTo check code coverage:\n\n```\nnpm run coverage\n```\n\n## Contributing\n\n[`Level/memdown`](https://github.com/Level/memdown) is an **OPEN Open Source Project**. This means that:\n\n> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.\n\nSee the [Contribution Guide](https://github.com/Level/community/blob/master/CONTRIBUTING.md) for more details.\n\n## Big Thanks\n\nCross-browser Testing Platform and Open Source ♥ Provided by [Sauce Labs](https://saucelabs.com).\n\n[![Sauce Labs logo](./sauce-labs.svg)](https://saucelabs.com)\n\n## Donate\n\nSupport us with a monthly donation on [Open Collective](https://opencollective.com/level) and help us continue our work.\n\n## License\n\n[MIT](LICENSE)\n\n[`abstract-leveldown`]: https://github.com/Level/abstract-leveldown\n\n[`levelup`]: https://github.com/Level/levelup\n\n[`encoding-down`]: https://github.com/Level/encoding-down\n\n[`leveldown`]: https://github.com/Level/leveldown\n\n[`level-mem`]: https://github.com/Level/mem\n\n[level-badge]: https://leveljs.org/img/badge.svg\n","publish_time":1527017582767,"deprecated":"Superseded by memory-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1527017582767,"dist-tags":{"latest":"6.1.1"}}