{"name":"memdown","version":"4.1.0","description":"An drop-in replacement for LevelDOWN that works in memory only","authors":["Rod Vagg <rod@vagg.org> (https://github.com/rvagg)"],"license":"MIT","main":"memdown.js","scripts":{"test":"standard && hallmark && nyc node test.js","test-browsers":"airtap --loopback airtap.local --coverage test.js","test-browser-local":"airtap --coverage --local test.js","coverage":"nyc report --reporter=text-lcov | coveralls","hallmark":"hallmark --fix","dependency-check":"dependency-check . immediate*.js test.js","prepublishOnly":"npm run dependency-check"},"browser":{"./immediate.js":"./immediate-browser.js"},"dependencies":{"abstract-leveldown":"~6.0.1","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":"^2.0.0","coveralls":"^3.0.2","dependency-check":"^3.3.0","hallmark":"^0.1.0","level-community":"^3.0.0","level-concat-iterator":"^2.0.0","nyc":"^14.0.0","standard":"^12.0.0","tape":"^4.8.0"},"hallmark":{"community":"level-community"},"repository":{"type":"git","url":"git+https://github.com/Level/memdown.git"},"homepage":"https://github.com/Level/memdown","keywords":["level","leveldb","leveldown","levelup","memory"],"engines":{"node":">=6"},"gitHead":"4920c465547d8c3604a45bc418fa099e5015741f","bugs":{"url":"https://github.com/Level/memdown/issues"},"_id":"memdown@4.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"email":"ralphtheninja@riseup.net","name":"ralphtheninja"},{"email":"r@va.gg","name":"rvagg"},{"email":"dev@vincentweevers.nl","name":"vweevers"}],"dist":{"integrity":"sha512-RqDUWsJ3IH27+dHwBOg6/ZWJoGul+tesnaQ10Pr/ARx7GpskB01Ky0zNZ8EkM6lvQqXcxyzukmXA0T39XW2sRw==","shasum":"4e667ec75ce524a8aa7391c10a5a357c6d4fde0e","tarball":"http://registry-npm.ywwl.com/memdown/download/memdown-4.1.0.tgz","fileCount":9,"unpackedSize":28588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFbWiCRA9TVsSAnZWagAAcpsP/2FN0iRkz/2ewa2WBLgG\n6u/uN342D9X6eT22NMFXTzq2dg/c1v5H7skMJNpfrs5O91zM+0vZAcWyc7Ai\nnlxM4Cq7tIcbu9UvL734mxvQXLKCpoR/+2X2+/+7gUizaHufGwyrTv+jaO7F\nwOO5zaN4SZ6MVeIUF1r7N7wwqGWpvZczfieNQ4PxyhmtXe+HMBwBKp8tNY/q\ngFCukH7CYKJOc9TpjmaEpWdY1a9zoiiA5Q8JH3piVU4HtlqMUqLSEKIUucuc\nUlncVX+g1yczTXJQh+JfFelykJ+r6sDViB+1FSOxYum2gTIuPJCYwicgFIJU\nM59I5WLFpIBBw5z+NIoaw82ItwdWdQsZedqGyhB/BX60MiSSM9kNPOOtEJAf\nEyJo3X7LbJFm8gFI1+GP6QtrKUSpD0gvhF1A+WAGu+SO1HSeLlUi4VnRtTDl\n757aa0Zy2qWXucebd6NK3l8Gpddmg0mTke+If0gBmJXAvDVSdGGHcM5LzK34\nK/2ijjq07KWtwCWblZDAI2vJQVMnEmRrHD5mukF5fdY1neMNuRh6zgewxsot\nbi6QyT4ullFjzrLi9KouanY2zZtKDTNg4IEqN1+YMBjFjxgZRT3j19VEpf6q\nWm251rrb7wOFVQK98voPeBB+7K83FPTVTrZ1rzVi5gi9Yc+3H57G1dJWpSfV\nPSCU\r\n=yvvY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBl5L0/eTPGNnVD/l1wMkaPden6N7iQAegA9jUPjhMikAiA4YcmDRbp7jbF25MOEzVMHq2SPnyzHCimYqCtDc9Kkxw=="}],"size":8268,"noattachment":false,"key":"/memdown/-/memdown-4.1.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memdown_4.1.0_1561703841335_0.8628635700351532"},"_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":1561703841518,"deprecated":"Superseded by memory-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1561703841518,"dist-tags":{"latest":"6.1.1"}}