{"_id":"memory-level","_rev":"5-528038808612a43c00247eb2ee499515","name":"memory-level","dist-tags":{"latest":"3.1.0"},"versions":{"1.0.0":{"name":"memory-level","version":"1.0.0","keywords":["level","leveldb","leveldown","levelup","memory"],"author":{"url":"https://github.com/rvagg","name":"Rod Vagg","email":"rod@vagg.org"},"license":"MIT","_id":"memory-level@1.0.0","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"homepage":"https://github.com/Level/memory-level","bugs":{"url":"https://github.com/Level/memory-level/issues"},"dist":{"shasum":"7323c3fd368f9af2f71c3cd76ba403a17ac41692","tarball":"https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz","fileCount":7,"integrity":"sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==","signatures":[{"sig":"MEUCIQCJpw50AuIK1C9kCAog5Vzfzx3Ux/QjPPz8MB3jlO62ewIgCbwzuj8f/RQumMRCf/mpPmO14YxDt6PYey6LmdO1qj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9wXHCRA9TVsSAnZWagAAzPcP/1QnqB4IYWdWy4mVDaL1\nQXo4OuA6hNFhjf2ay2RqMdUTPCpqH+o3POaUWwSkIO7jr/jbQ+2QBHnGkyAv\n62wgtcXuijTxsywFrHrr8Y4czl7iA7RbFRk+QtiG/Z6MEIr1R95ZY/Zao6Fs\nSwPR7GRHV4JwGGUErwwkxhk8YfJCuFw9AlknW4dt9GEF4bw4CzGgWaQjdOTd\n623jRHpTD5c3bt8iGA1gPPHcdmR/IYhU8RYC79UxIJKRitpt4m7dBp5sADFC\n3S44Ht1iW6ZezU4coEG1m8Rywcf2a9SNHfPvh2pAw3TkzN/VI57RXiYnsTzr\nXtdd6ay2BAdAr57nQl19biIoO/15+4oWeZdnmTv8ApzuzS1iyChL4T9gs1Ga\nK0K1J4KmZueRuOoTGteqAGfhjIzU4VyV4HtNHemd8ffMwefmWj8PBg8Qzr6F\nqoxNWMP3oLZV5LwCZMm/SBF6iasLUsbB1JsHvRQraa6LsvbPWH9G2PaPlnZk\nYESf8gnlXmWNCdit6VVXg8JvvaLW8WPDEEqjnIG+zQeoAt1ZacXlqKjpjww9\ngQBol6HAnDlXpyRiZVet+k3/vvgsQBtObH7mWK5Brqakc5LS0JbPQvtQqUeD\nD1PqSOJfVR6v4eve6W39tgoAuXBMeziaWw5lnVQvd3i6ez/kr2NkEYGAhTqd\nlFal\r\n=6Dwi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"./index.d.ts","engines":{"node":">=12"},"gitHead":"16aae241a8d99a8e9e70d40f79e277ddb09a0445","scripts":{"test":"standard && ts-standard *.ts && hallmark && (nyc -s node test.js | faucet) && nyc report","coverage":"nyc report -r lcovonly","test-browsers":"airtap --coverage --verbose test.js","test-browsers-local":"airtap --coverage -p local test.js"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"repository":{"url":"git+https://github.com/Level/memory-level.git","type":"git"},"_npmVersion":"7.21.1","description":"In-memory abstract-level database for Node.js and browsers","directories":{},"_nodeVersion":"16.9.1","dependencies":{"module-error":"^1.0.1","abstract-level":"^1.0.0","functional-red-black-tree":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","tape":"^5.0.1","airtap":"^4.0.3","buffer":"^6.0.3","faucet":"^0.0.1","hallmark":"^4.0.0","standard":"^16.0.3","typescript":"^4.5.5","ts-standard":"^11.0.0","airtap-sauce":"^1.1.0","airtap-playwright":"^1.0.1","@voxpelli/tsconfig":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/memory-level_1.0.0_1643578823614_0.08023390210998649","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"memory-level","version":"2.0.0","keywords":["level","leveldb","leveldown","levelup","memory"],"author":{"url":"https://github.com/rvagg","name":"Rod Vagg","email":"rod@vagg.org"},"license":"MIT","_id":"memory-level@2.0.0","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"homepage":"https://github.com/Level/memory-level","bugs":{"url":"https://github.com/Level/memory-level/issues"},"dist":{"shasum":"d31910ea201fb6bdcc971e2737987c5a14116ad2","tarball":"https://registry.npmjs.org/memory-level/-/memory-level-2.0.0.tgz","fileCount":7,"integrity":"sha512-0EzmXmk4vCVu7J/x+4g6yxGM7jLRAlRH0QKE5+b2XLBoNovuyDiCgmTf6MVtgiUdP51D5jgl18N7ZrD49NDOHQ==","signatures":[{"sig":"MEYCIQCZZ62YzarJpEcjtQArN0iUg5FTv5OOYZvmiXqfXpE21wIhAICPZiz8ioKMPlYTm6chfTBA57o+JD7V6usKPXJZOGWm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24196},"main":"index.js","types":"./index.d.ts","engines":{"node":">=18"},"gitHead":"dff10fa8624e21a39dfcad31cefa2735cffc1746","scripts":{"test":"standard && hallmark && (nyc -s node test.js | tap-arc) && nyc report","coverage":"nyc report -r lcovonly","test-browsers":"airtap --coverage --verbose test.js","test-pessimistic":"node test.js | tap-arc -pv","test-browsers-local":"airtap --coverage -p local test.js"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"repository":{"url":"git+https://github.com/Level/memory-level.git","type":"git"},"_npmVersion":"10.8.2","description":"In-memory abstract-level database for Node.js and browsers","directories":{},"_nodeVersion":"22.7.0","dependencies":{"module-error":"^1.0.1","abstract-level":"^2.0.1","functional-red-black-tree":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","tape":"^5.0.1","airtap":"^4.0.3","buffer":"^6.0.3","tap-arc":"^1.3.2","hallmark":"^5.0.1","standard":"^17.0.0","typescript":"^5.6.3","airtap-sauce":"^1.1.0","airtap-playwright":"^1.0.1","@voxpelli/tsconfig":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/memory-level_2.0.0_1729549635795_0.13040961106474414","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"memory-level","version":"3.0.0","keywords":["level","leveldb","leveldown","levelup","memory"],"author":{"url":"https://github.com/rvagg","name":"Rod Vagg","email":"rod@vagg.org"},"license":"MIT","_id":"memory-level@3.0.0","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"homepage":"https://github.com/Level/memory-level","bugs":{"url":"https://github.com/Level/memory-level/issues"},"dist":{"shasum":"d8d597d1e0910bedf37604398c7a63eba909009d","tarball":"https://registry.npmjs.org/memory-level/-/memory-level-3.0.0.tgz","fileCount":11,"integrity":"sha512-2g/DdA+vrazyAaofQNSD4yFiNen4K3C4/8dKiSiacbO0tuoRdUQwzc7GvHEVnWlzt2Lwdz5wgk8vGKJp67/Cwg==","signatures":[{"sig":"MEUCIEYW7FFHa2bxAsxZtDTNeSIH4PsuDSX5u5Ts41/ROy/cAiEApbl+tJr4KSJcFyETYqAGB1wBlafS+sVx8MKR5MnO3Gg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27357},"main":"index.js","types":"./index.d.ts","engines":{"node":">=18"},"gitHead":"6eac9e968463fd3f01e6e1f0852fa8178c729cce","scripts":{"test":"standard && hallmark && (nyc -s node test.js | tap-arc) && nyc report","coverage":"nyc report -r lcovonly","test-browsers":"airtap --coverage test.js","test-pessimistic":"node test.js | tap-arc -pv"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"repository":{"url":"git+https://github.com/Level/memory-level.git","type":"git"},"_npmVersion":"10.8.2","description":"In-memory abstract-level database for Node.js and browsers","directories":{},"_nodeVersion":"22.7.0","dependencies":{"module-error":"^1.0.1","abstract-level":"^3.0.1","functional-red-black-tree":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","tape":"^5.0.1","airtap":"^5.0.0","buffer":"^6.0.3","tap-arc":"^1.3.2","babelify":"^10.0.0","hallmark":"^5.0.1","standard":"^17.0.0","typescript":"^5.6.3","@babel/preset-env":"^7.26.0","airtap-playwright":"^1.0.1","@voxpelli/tsconfig":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/memory-level_3.0.0_1737907755097_0.23055321855150201","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"memory-level","version":"3.1.0","description":"In-memory abstract-level database for Node.js and browsers","author":{"name":"Rod Vagg","email":"rod@vagg.org","url":"https://github.com/rvagg"},"license":"MIT","main":"index.js","types":"./index.d.ts","scripts":{"test":"standard && hallmark && (nyc -s node test.js | tap-arc) && nyc report","test-pessimistic":"node test.js | tap-arc -pv","test-browsers":"airtap --coverage test.js","coverage":"nyc report -r lcovonly"},"dependencies":{"abstract-level":"^3.1.0","functional-red-black-tree":"^1.0.1","module-error":"^1.0.1"},"devDependencies":{"@babel/preset-env":"^7.26.9","@voxpelli/tsconfig":"^15.1.2","airtap":"^5.0.0","airtap-playwright":"^1.0.1","babelify":"^10.0.0","buffer":"^6.0.3","hallmark":"^5.0.1","nyc":"^17.1.0","standard":"^17.0.0","tap-arc":"^1.3.2","tape":"^5.0.1","typescript":"^5.8.3"},"repository":{"type":"git","url":"git+https://github.com/Level/memory-level.git"},"homepage":"https://github.com/Level/memory-level","keywords":["level","leveldb","leveldown","levelup","memory"],"engines":{"node":">=18"},"_id":"memory-level@3.1.0","gitHead":"4b555c625f79a4f1f10ebcf4405f56e352590309","bugs":{"url":"https://github.com/Level/memory-level/issues"},"_nodeVersion":"22.7.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-mTqFVi5iReKcjue/pag0OY4VNU7dlagCyjjPwWGierpk1Bpl9WjOxgXIswymPW3Q9bj3Foay+Z16mPGnKzvTkQ==","shasum":"76d971f50072e3408ca7aacf3e97eeddea293517","tarball":"https://registry.npmjs.org/memory-level/-/memory-level-3.1.0.tgz","fileCount":11,"unpackedSize":27768,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIG6Ib3skME7AIoj6K4BNfoCKhHtT+ia6EjXtqLH0B9MPAiA/C4OABNizCPXSu9461vaDFAyUZzyUwZTkZPCeygIDmA=="}]},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memory-level_3.1.0_1745158296816_0.5810186579702328"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-30T21:40:23.613Z","modified":"2025-04-20T14:11:37.178Z","1.0.0":"2022-01-30T21:40:23.732Z","2.0.0":"2024-10-21T22:27:16.050Z","3.0.0":"2025-01-26T16:09:15.325Z","3.1.0":"2025-04-20T14:11:36.992Z"},"bugs":{"url":"https://github.com/Level/memory-level/issues"},"author":{"name":"Rod Vagg","email":"rod@vagg.org","url":"https://github.com/rvagg"},"license":"MIT","homepage":"https://github.com/Level/memory-level","keywords":["level","leveldb","leveldown","levelup","memory"],"repository":{"type":"git","url":"git+https://github.com/Level/memory-level.git"},"description":"In-memory abstract-level database for Node.js and browsers","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"readme":"# memory-level\n\n**In-memory [`abstract-level`][abstract-level] database for Node.js and browsers, backed by a [fully persistent red-black tree](https://www.npmjs.com/package/functional-red-black-tree).** The successor to [`memdown`](https://github.com/Level/memdown) and [`level-mem`](https://github.com/Level/mem).\n\n> :pushpin: Wondering what happened to `levelup`? Visit [Frequently Asked Questions](https://github.com/Level/community#faq).\n\n[![level badge][level-badge]](https://github.com/Level/awesome)\n[![npm](https://img.shields.io/npm/v/memory-level.svg)](https://www.npmjs.com/package/memory-level)\n[![Node version](https://img.shields.io/node/v/memory-level.svg)](https://www.npmjs.com/package/memory-level)\n[![Test](https://img.shields.io/github/actions/workflow/status/Level/memory-level/test.yml?branch=main\\&label=test)](https://github.com/Level/memory-level/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/memory-level?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/memory-level)\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## Usage\n\n_If you are upgrading: please see [`UPGRADING.md`](./UPGRADING.md)._\n\n```js\nconst { MemoryLevel } = require('memory-level')\n\n// Create a database\nconst db = new MemoryLevel({ valueEncoding: 'json' })\n\n// Add an entry with key 'a' and value 1\nawait db.put('a', 1)\n\n// Add multiple entries\nawait db.batch([{ type: 'put', key: 'b', value: 2 }])\n\n// Get value of key 'a': 1\nconst value = await db.get('a')\n\n// Iterate entries with keys that are greater than 'a'\nfor await (const [key, value] of db.iterator({ gt: 'a' })) {\n  console.log(value) // 2\n}\n```\n\n## API\n\nThe API of `memory-level` follows that of [`abstract-level`](https://github.com/Level/abstract-level) with one additional constructor option (see below). The `createIfMissing` and `errorIfExists` options of `abstract-level` are not relevant here. Both implicit and explicit snapshots are supported. Data is discarded when the last reference to the database is released (i.e. `db = null`). Closing or reopening the database has no effect on the data. Data is _not_ copied: when storing a Buffer value for example, subsequent mutations to that Buffer will affect the stored data too.\n\n### `db = new MemoryLevel([options])`\n\nBesides `abstract-level` options, the optional `options` object may contain:\n\n- `storeEncoding` (string): one of `'buffer'`, `'view'`, `'utf8'`. How to store data internally. This affects which data types can be stored non-destructively. The default is `'buffer'` (that means Buffer) which is non-destructive. In browsers it may be preferable to use `'view'` (Uint8Array) to be able to exclude the [`buffer`](https://github.com/feross/buffer) shim. Or if there's no need to store binary data, then `'utf8'` (String). Regardless of the `storeEncoding`, `memory-level` supports input that is of any of the aforementioned types, but internally converts it to one type in order to provide a consistent sort order.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install memory-level\n```\n\n## Contributing\n\n[`Level/memory-level`](https://github.com/Level/memory-level) 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## License\n\n[MIT](LICENSE)\n\n[abstract-level]: https://github.com/Level/abstract-level\n\n[level-badge]: https://leveljs.org/img/badge.svg\n","readmeFilename":"README.md"}