{"name":"memory-level","version":"1.0.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 && ts-standard *.ts && 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"},"dependencies":{"abstract-level":"^1.0.0","functional-red-black-tree":"^1.0.1","module-error":"^1.0.1"},"devDependencies":{"@voxpelli/tsconfig":"^3.1.0","airtap":"^4.0.3","airtap-playwright":"^1.0.1","airtap-sauce":"^1.1.0","buffer":"^6.0.3","faucet":"^0.0.1","hallmark":"^4.0.0","nyc":"^15.1.0","standard":"^16.0.3","tape":"^5.0.1","ts-standard":"^11.0.0","typescript":"^4.5.5"},"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":">=12"},"gitHead":"16aae241a8d99a8e9e70d40f79e277ddb09a0445","bugs":{"url":"https://github.com/Level/memory-level/issues"},"_id":"memory-level@1.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==","shasum":"7323c3fd368f9af2f71c3cd76ba403a17ac41692","tarball":"http://registry-npm.ywwl.com/memory-level/download/memory-level-1.0.0.tgz","fileCount":7,"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","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJpw50AuIK1C9kCAog5Vzfzx3Ux/QjPPz8MB3jlO62ewIgCbwzuj8f/RQumMRCf/mpPmO14YxDt6PYey6LmdO1qj4="}],"size":7551,"noattachment":false,"key":"/memory-level/-/memory-level-1.0.0.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memory-level_1.0.0_1643578823614_0.08023390210998649"},"_hasShrinkwrap":false,"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: Which module should I use? What is `abstract-level`? Head over to the [FAQ](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/workflow/status/Level/memory-level/Test?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\nWith callbacks:\n\n```js\ndb.put('example', { hello: 'world' }, (err) => {\n  if (err) throw err\n\n  db.get('example', (err, value) => {\n    if (err) throw err\n    console.log(value) // { hello: 'world' }\n  })\n})\n```\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## API\n\nThe API of `memory-level` follows that of [`abstract-level`](https://github.com/Level/abstract-level) with a one additional constructor option (see below). The `createIfMissing` and `errorIfExists` options of `abstract-level` are not relevant here. 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<!-- ## 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## 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","publish_time":1643578823732,"_cnpm_publish_time":1643578823732,"dist-tags":{"latest":"3.1.0"}}