{"name":"memdown","version":"6.1.1","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 -s node test.js | faucet) && nyc report","test-browsers":"airtap --coverage --verbose test.js","test-browsers-local":"airtap --coverage -p local test.js","coverage":"nyc report -r lcovonly","hallmark":"hallmark --fix","dependency-check":"dependency-check . test.js","prepublishOnly":"npm run dependency-check"},"dependencies":{"abstract-leveldown":"^7.2.0","buffer":"^6.0.3","functional-red-black-tree":"^1.0.1","inherits":"^2.0.1","ltgt":"^2.2.0"},"devDependencies":{"airtap":"^4.0.3","airtap-playwright":"^1.0.1","airtap-sauce":"^1.1.0","dependency-check":"^3.3.0","faucet":"^0.0.1","hallmark":"^3.1.0","level-concat-iterator":"^3.0.0","nyc":"^15.1.0","standard":"^16.0.3","tape":"^5.0.1"},"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":">=10"},"gitHead":"045028c4de5c82b828f4cc688c996a6ddf60a1e7","bugs":{"url":"https://github.com/Level/memdown/issues"},"_id":"memdown@6.1.1","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-vh2RiuVrn6Vv73088C1KzLwy9+hhRwoZsgddYqIoVuFFrcoc2Rt+lq/KrmkFn6ulko7AtQ0AvqtYid35exb38A==","shasum":"ab52fae1a029affb40af60fda9d247a5733e4dc3","tarball":"http://registry-npm.ywwl.com/memdown/download/memdown-6.1.1.tgz","fileCount":6,"unpackedSize":31118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2zB3CRA9TVsSAnZWagAA24gP/3RKZifBTD19PCkHZFYs\nD+1WdvkmJ1unJ7gcnMhcliCIQoXfqWewECOxZ4TL0wKRpqORqtTp2GR+EbUu\nGCnSZPBkSw65Tad1XbeQrZNL92Jzb2qTn1Dn6jqMCYRNw1WZUwrlqYX4AWBc\nLhefGZwRwLM7BIkn6XkoU2C0nNFbEJWaIwdPWh+nwNsmI7HSmcI7pHKku/pk\nHe61ieOMNpk2gBPK0qSR3ikZch6jtsvG2dVIVNMCk5H9V6b2h8d4sgWl9tlo\nWr3jYufjKJCFQG7bExTAzP5M1Ywjl+/Id+wXWWiswYLlrg9YYvdfm0UtobuQ\nkwPSV5/mrglZF2BrulyMQ32Ji6xtdyvm4UD2m/Ykiu4p1mO7iOqSlMcGhNNJ\n6TDEJPbLWIekLsFRyoK67V9FCAZ5MLoq4kb8+a3pdbM5o97uMSKhu4Tv6QZ4\niwrJiK0+TkRNPy9JZ5P1fljIlcdx+eq8Gu6vC6nAGFJEdEebrvmOi8gIqT6O\nQZwMPno+AFM3CX0WxwLVEm5NthwLMyg6AmB4gAVbij1tZIhr72ChsBJlSq8x\n39UMHju76E8edJo/o+OZqXikBeIm0Yx4acyyJX7qPH854Yj8/PinAMbk5X/P\nHTZ6Gd1XzPxK9sLfQ6CRcZZ0MUBhuHAtNIGj7DyIyHcFmbWEbz6cuNJb1P8V\nruGC\r\n=nZXA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjBUlqzDfNsAIOL16aR+dw/kx7j5ccrxnUDd6AKtA4JAIgemOrnEyVKEnE652BhFKsVn+Hjzzde9d3xFh0Wf1H8T4="}],"size":8728,"noattachment":false,"key":"/memdown/-/memdown-6.1.1.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"},{"name":"rvagg","email":"r@va.gg"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memdown_6.1.1_1633171029524_0.4707141096168721"},"_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":1633171029701,"deprecated":"Superseded by memory-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1633171029701,"dist-tags":{"latest":"6.1.1"}}