{"versions":{"1.0.0":{"name":"browser-level","version":"1.0.0","description":"An abstract-level database for browsers, backed by IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","types":"./index.d.ts","scripts":{"test":"standard && ts-standard *.ts && hallmark && airtap -p local --coverage test/index.js && nyc report","test-browsers":"standard && airtap --coverage test/index.js","coverage":"nyc report -r lcovonly","dependency-check":"dependency-check --no-dev .","prepublishOnly":"npm run dependency-check"},"dependencies":{"abstract-level":"^1.0.1","catering":"^2.1.1","module-error":"^1.0.2","run-parallel-limit":"^1.1.0"},"devDependencies":{"@voxpelli/tsconfig":"^3.1.0","airtap":"^4.0.4","airtap-playwright":"^1.0.1","airtap-sauce":"^1.1.0","dependency-check":"^4.1.0","hallmark":"^4.1.0","nyc":"^15.0.0","standard":"^16.0.4","tape":"^5.5.2","ts-standard":"^11.0.0","typescript":"^4.5.5","uuid":"^3.3.2"},"repository":{"type":"git","url":"git+https://github.com/Level/browser-level.git"},"homepage":"https://github.com/Level/browser-level","keywords":["level","leveldb","indexeddb","abstract-level"],"gitHead":"3f8488003d93ed8cf4252e19b670ec2a3ff9ad79","bugs":{"url":"https://github.com/Level/browser-level/issues"},"_id":"browser-level@1.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-fqLv/fmckANcr1i6G6c18O1tLyhG5Mis3fUwLTrATmvCuT4mUwZhKeFJFPaJo0EWsssPSuPdfFuQNTSEXxzIXQ==","shasum":"585a854b1d566bd94999295762752852d6e4b6c3","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/browser-level/-/browser-level-1.0.0.tgz","fileCount":12,"unpackedSize":40495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI3+OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDFg/9HWoYMMz3ZChMY5PrIcMDfQARUJNwKlMBGLFO3rjlnScPuYHc\r\n9qdsdrbasPYkk2oW/70F81HFBQooW87DxovnImJNAIAHIrlvhXSIk+rxaV0u\r\noBh2WSpI1lgwNDONy0tah8Nszk+ucAlteRuP/Jh5oSV1TyMbGeQ8b0S8SSLs\r\nEZAQEr4P817cxMqOxKUlr/kIOFnlB8/DM1/SebkF23axglmTHnF+YUnW2qm6\r\nvd73sLPT4H2Qq+Kyu1hAGEVo5rHt6HSxnjYl4hnkhj7p1oJJYoxblR3tkZ6n\r\nT4rc9j6krvGauU9HllLquCJlpd6ZktI784kMepR5vZSR1Bj6oOycn6e4eBBP\r\nOcBaLq+u6UQkjMX/vJMwvG6AxZdbP253ptl50NdbtV3Z8Z0j8zwSOWw6Oq50\r\nMIHNMZdgtt88o3TIDUuIH6uIwFg21oCCTTy6ovvWOB3s+uUGEkNWR7je40hq\r\nag/ENGn2q9Te+DPJTG4FF0pefI9aQWCKt506X4wschs9aoDYY01/+N3u4Yzj\r\n1PRloiqPxjQUmnSbhnVJzsjmyPPtNi3UffowwVae83eyNeFMFwlWaMDcOohj\r\nCtszMdosF9FvIppBVDbDnjb1QbwQaeDz3ejq37jlQ8OEsev1mvwlYTtGlHan\r\nR1YWWFPpV73lU1vW3jjzbvNhBo2B0MUEoVg=\r\n=bBeM\r\n-----END PGP SIGNATURE-----\r\n","size":12998},"_npmUser":{"name":"anonymous","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"anonymous","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-level_1.0.0_1646493582094_0.21036697169157614"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-05T15:19:45.313Z","contributors":[]},"1.0.1":{"name":"browser-level","version":"1.0.1","description":"An abstract-level database for browsers, backed by IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","types":"./index.d.ts","scripts":{"test":"standard && ts-standard *.ts && hallmark && airtap -p local --coverage test/index.js && nyc report","test-browsers":"standard && airtap --coverage test/index.js","coverage":"nyc report -r lcovonly","dependency-check":"dependency-check --no-dev .","prepublishOnly":"npm run dependency-check"},"dependencies":{"abstract-level":"^1.0.2","catering":"^2.1.1","module-error":"^1.0.2","run-parallel-limit":"^1.1.0"},"devDependencies":{"@voxpelli/tsconfig":"^3.1.0","airtap":"^4.0.4","airtap-playwright":"^1.0.1","airtap-sauce":"^1.1.0","dependency-check":"^4.1.0","hallmark":"^4.1.0","nyc":"^15.0.0","standard":"^16.0.4","tape":"^5.5.2","ts-standard":"^11.0.0","typescript":"^4.5.5","uuid":"^3.3.2"},"repository":{"type":"git","url":"git+https://github.com/Level/browser-level.git"},"homepage":"https://github.com/Level/browser-level","keywords":["level","leveldb","indexeddb","abstract-level"],"gitHead":"5f7585e8cf025d9c9bb36da2425322130104bbb0","bugs":{"url":"https://github.com/Level/browser-level/issues"},"_id":"browser-level@1.0.1","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==","shasum":"36e8c3183d0fe1c405239792faaab5f315871011","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/browser-level/-/browser-level-1.0.1.tgz","fileCount":12,"unpackedSize":42387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJLqmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJzQ/7B2ntBK2EWBZhGs9Y8iZUpqUpVPO+U88jKeXNJNSiT+DbDr44\r\nG8yDlaD41UFy2TBA6LWmVQSui6rRwjX82A8ZPnEng4UCP5O0DqZGb6k9Xh6I\r\n2nCQnzkQtDe532kr1ZBn9WAnn2iAuzXsUTFxGFaR0dm0UrHJGpDOhgf3CMYy\r\nnuLZ0Vd68PDqMc9uSObjhGh+1NgbQfvD8gwcXFpSaRu2na780Wnknr7nh7ku\r\nCIt13bceT2TbueWNdyjHzknBoFOUhzeh2niDLRKBy96zhcCau403pS8cXGLu\r\nKWBt8aIc9ghAE9kcdRr+NnnhYaHaojhwSt8RuVu+Ik0UxzxiL1S6bS5Nl0AK\r\n6pWcD1ux7TT+ECc5gpEY94acKy4ird6KlHNuR4OD1pTkWUOCjv477nC7zmmx\r\npIHvaTsgh0HoeCza3EdL4gVK7b60OpG3ON9XXAozRiaYuvvAXv2jMTzb6xAv\r\n8RUmnm9RpbpqAe/O7GtOFQWc7m7ggT94Uo66qbwnXJ8c6JhV6FkuYI9Ri24w\r\n/lRmwvF2/HStVZiuFNxDjw5yprycE4bhgqGudanjsOwBnxQSc0fOKGECxV2N\r\nNmbrhG7o+0kW5m1bIkP4V9B6IZVbxQ7lE9nsjpe7qJDljU7sT1uqTizpzaW2\r\nMNAFXnShf3VTB/VY6DV2vig63GD64WweIYo=\r\n=Vuno\r\n-----END PGP SIGNATURE-----\r\n","size":13385},"_npmUser":{"name":"anonymous","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"anonymous","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-level_1.0.1_1646574246707_0.16722342304360938"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-06T13:44:09.892Z","contributors":[]},"2.0.0":{"name":"browser-level","version":"2.0.0","description":"An abstract-level database for browsers, backed by IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","types":"./index.d.ts","scripts":{"test":"standard && hallmark && airtap --coverage test/index.js && nyc report","coverage":"nyc report -r lcovonly"},"dependencies":{"abstract-level":"^2.0.1"},"devDependencies":{"@voxpelli/tsconfig":"^4.0.0","airtap":"^5.0.0","airtap-playwright":"^1.0.1","hallmark":"^4.1.0","nyc":"^15.0.0","standard":"^17.0.0","tape":"^5.5.2","typescript":"^4.5.5","uuid":"^3.3.2"},"repository":{"type":"git","url":"git+https://github.com/Level/browser-level.git"},"homepage":"https://github.com/Level/browser-level","keywords":["level","leveldb","indexeddb","abstract-level"],"_id":"browser-level@2.0.0","gitHead":"07f0e65d468a377fcf516e2077712224df937c4c","bugs":{"url":"https://github.com/Level/browser-level/issues"},"_nodeVersion":"22.7.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-RuYSCHG/jwFCrK+KWA3dLSUNLKHEgIYhO5ORPjJMjCt7T3e+RzpIDmYKWRHxq2pfKGXjlRuEff7y7RESAAgzew==","shasum":"cc63eb1322e67c44489d7fbdda5c30a2db7b59da","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/browser-level/-/browser-level-2.0.0.tgz","fileCount":11,"unpackedSize":35905,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICkNxn26UKs+ATBt9EnSGZsTxicCfwsHBC3kGeQ8JSeVAiBcA3AWcLMe2sWIIABMwismT/VIyXgONWH+WwDm/5+/MA=="}],"size":10940},"_npmUser":{"name":"anonymous","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"anonymous","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-level_2.0.0_1733060550310_0.2282011038089964"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-01T13:42:30.522Z","publish_time":1733060550522,"_source_registry_name":"default","contributors":[]},"3.0.0":{"name":"browser-level","version":"3.0.0","description":"An abstract-level database for browsers, backed by IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","types":"./index.d.ts","scripts":{"test":"standard && hallmark && airtap --coverage test/index.js && nyc report","coverage":"nyc report -r lcovonly"},"dependencies":{"abstract-level":"^3.1.0"},"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","hallmark":"^5.0.1","nyc":"^17.1.0","standard":"^17.0.0","tape":"^5.5.2","typescript":"^5.8.3","uuid":"^11.1.0"},"repository":{"type":"git","url":"git+https://github.com/Level/browser-level.git"},"homepage":"https://github.com/Level/browser-level","keywords":["level","leveldb","indexeddb","abstract-level"],"_id":"browser-level@3.0.0","gitHead":"7ae3bae52ec48f2979b48516f2546863054dad89","bugs":{"url":"https://github.com/Level/browser-level/issues"},"_nodeVersion":"22.7.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-kGXtLh29jMwqKaskz5xeDLtCtN1KBz/DbQSqmvH7QdJiyGRC7RAM8PPg6gvUiNMa+wVnaxS9eSmEtP/f5ajOVw==","shasum":"158287e21f44051cc06bf05abc235b385e66d264","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/browser-level/-/browser-level-3.0.0.tgz","fileCount":11,"unpackedSize":38001,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD1RHTPw6papsVVQPdoPwsJU7k+571wGW1IXgK7GNjtwgIhAPNotEyInMkI1av5GkqYOcP2MkZe6Z3PhPNsLgIHkK5p"}],"size":11205},"_npmUser":{"name":"anonymous","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"anonymous","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/browser-level_3.0.0_1745164243508_0.4800709787880444"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-04-20T15:50:43.709Z","publish_time":1745164243709,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"3.0.0"},"name":"browser-level","time":{"created":"2022-03-05T15:19:48.717Z","modified":"2025-04-20T15:50:50.390Z","1.0.0":"2022-03-05T15:19:42.260Z","1.0.1":"2022-03-06T13:44:06.800Z","2.0.0":"2024-12-01T13:42:30.522Z","3.0.0":"2025-04-20T15:50:43.709Z"},"readme":"# browser-level\n\n**An [`abstract-level`][abstract-level] database for browsers, backed by [IndexedDB][indexeddb].** The successor to [`level-js`](https://github.com/Level/level-js). If you are upgrading, please see [UPGRADING.md](UPGRADING.md).\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]][awesome]\n[![npm](https://img.shields.io/npm/v/browser-level.svg)](https://www.npmjs.com/package/browser-level)\n[![Test](https://img.shields.io/github/actions/workflow/status/Level/browser-level/test.yml?branch=main\\&label=test)](https://github.com/Level/browser-level/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/browser-level?label=\\&logo=codecov\\&logoColor=fff)](https://codecov.io/gh/Level/browser-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```js\nconst { BrowserLevel } = require('browser-level')\n\n// Create a database called 'example'\nconst db = new BrowserLevel('example', { 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 `browser-level` follows that of [`abstract-level`](https://github.com/Level/abstract-level) with just two additional constructor options (see below) and one additional method (see below). As such, the majority of the API is documented in `abstract-level`. The `db.getSync()` method is not supported here and neither are the `createIfMissing` and `errorIfExists` options.\n\nLike other implementations of `abstract-level`, `browser-level` has first-class support of binary keys and values, using either [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) or [Buffer](https://nodejs.org/api/buffer.html). In order to sort string and binary keys the same way as other databases, `browser-level` internally converts data to a Uint8Array before passing them to IndexedDB. If you have no need to work with `Buffer` keys or values, you can choose to omit the [`buffer`](https://github.com/feross/buffer) shim from a JavaScript bundle (through configuration of Webpack, Browserify or other bundlers).\n\nDue to limitations of IndexedDB, `browser-level` does not offer snapshot guarantees. Such a guarantee would mean that an iterator does not see the data of simultaneous writes - it would be reading from a snapshot in time. In contrast, a `browser-level` iterator reads a few entries ahead and then opens a new IndexedDB transaction on the next read. A \"few\" means all entries for `iterator.all()`, `size` amount of entries for `iterator.nextv(size)` and a hardcoded 100 entries for `iterator.next()`. Individual calls to those methods have snapshot guarantees but repeated calls do not.\n\nThe result is that an iterator will include the data of simultaneous writes, if `db.put()`, `db.del()` or `db.batch()` are called in between creating the iterator and consuming the iterator, or in between calls to `iterator.next()` or `iterator.nextv()`. For example:\n\n```js\nconst iterator = db.iterator()\nawait db.put('abc', '123')\n\nfor await (const [key, value] of iterator) {\n  // This might be 'abc'\n  console.log(key)\n}\n```\n\nIf snapshot guarantees are a must for your application then use `iterator.all()` and call it immediately after creating the iterator:\n\n```js\nconst entries = await db.iterator({ limit: 50 }).all()\n\n// Synchronously iterate the result\nfor (const [key, value] of entries) {\n  console.log(key)\n}\n```\n\n### `db = new BrowserLevel(location[, options])`\n\nCreate a new database or open an existing one. The required `location` argument is the string name of the [`IDBDatabase`](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) to be opened, as well as the name of the object store within that database. The name of the `IDBDatabase` will be prefixed with `options.prefix`.\n\nBesides `abstract-level` options, the optional `options` argument may contain:\n\n- `prefix` (string, default: `'level-js-'`): Prefix for the `IDBDatabase` name. Can be set to an empty string. The default is compatible with `level-js`.\n- `version` (string or number, default: `1`): The version to open the `IDBDatabase` with.\n\nSee [`IDBFactory#open()`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open) for more details about database name and version.\n\n### `BrowserLevel.destroy(location[, prefix])`\n\nDelete the IndexedDB database at the given `location`. Returns a promise. If `prefix` is not given, it defaults to the same value as the `BrowserLevel` constructor does. This method is an additional method that is not part of the [`abstract-level`](https://github.com/Level/abstract-level) interface.\n\nBefore calling `destroy()`, close a database if it's using the same `location` and `prefix`:\n\n```js\nconst db = new BrowserLevel('example')\nawait db.close()\nawait BrowserLevel.destroy('example')\n```\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install browser-level\n```\n\nThis module is best used with [`browserify`](http://browserify.org) or similar bundlers.\n\n## Contributing\n\n[`Level/browser-level`](https://github.com/Level/browser-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## 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[level-badge]: https://leveljs.org/img/badge.svg\n\n[indexeddb]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n\n[awesome]: https://github.com/Level/awesome\n\n[abstract-level]: https://github.com/Level/abstract-level","users":{}}