{"name":"level-js","version":"6.0.0","description":"An abstract-leveldown compliant store on top of IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","scripts":{"test":"standard && hallmark && airtap -p local --coverage test/index.js","test-browsers":"standard && airtap --coverage test/index.js","coverage":"nyc report --reporter=text-lcov | coveralls","hallmark":"hallmark --fix","dependency-check":"dependency-check --no-dev -i buffer .","prepublishOnly":"npm run dependency-check"},"dependencies":{"abstract-leveldown":"^7.0.0","buffer":"^6.0.3","inherits":"^2.0.3","ltgt":"^2.1.2"},"devDependencies":{"airtap":"^4.0.1","airtap-playwright":"^1.0.1","airtap-sauce":"^1.1.0","coveralls":"^3.0.2","dependency-check":"^4.1.0","hallmark":"^3.0.0","level-community":"^3.0.0","level-concat-iterator":"^3.0.0","nyc":"^15.0.0","standard":"^16.0.3","tape":"^5.0.0","uuid":"^3.3.2"},"hallmark":{"community":"level-community"},"repository":{"type":"git","url":"git+https://github.com/Level/level-js.git"},"homepage":"https://github.com/Level/level-js","keywords":["level","leveldb","indexeddb","abstract-leveldown"],"gitHead":"355e809bdce51befb1ee2d3bdc0b4b9980e4bf4c","bugs":{"url":"https://github.com/Level/level-js/issues"},"_id":"level-js@6.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"}],"dist":{"integrity":"sha512-7dp7JuaoQoqKW4ZGvrV1RB5f51/ktLdEo9fSDsh3Ofmg7sKCMu3X0CIngbY/IUz/YyskhN7LRvEVIkZHCY3LKQ==","shasum":"1faff0eb92ca34e4565d1f7bca7026989855625b","tarball":"http://registry-npm.ywwl.com/level-js/download/level-js-6.0.0.tgz","fileCount":14,"unpackedSize":68032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcK96CRA9TVsSAnZWagAAnRMP/2lIHRfX77uSzB0yz36A\nXwRnDuvAh6H3KakgdBl7ljZJp83iiM4Dkeutv7uQJ8dnt8NSghMmacWD1a9q\nDyBaj2JwLk982XoYFyYuZ7GCmeBE7Kce3iWvWVoSkRjIK+GmCJzz+z9Ir+J+\nV5XOJbrhEE5utPsiGWc+dzLdJPz/CLKpwYQ+R7HTPdVrvZTLZIO5u11lZ6vd\nFBzksZH1+D9ZTn8TuBC8GamSKLZEvAOqPXmYGBibLOuX2dkFIbRnRNGvkKXs\nbpQrGKUughg6Pmg6JgT3E3SYUKIXaTpUTJCMQa09K3KlFxsbm1arOKQzoLTS\noWt9dD1TqRYu2xtMUoL8koI79K6Z8tEWyHeBVyUawdo9IlcecieEQTAYDRcX\nZpB9SUvNsnsCtcNAoMCDDH+BYUh93GrNzG5qo36vsY6JWf1/wajSTk8PiZjQ\n3MN3aPIIU6qBb08z/GxLf17T3BUSJlmmxA/HF+NErCrevMfVGq8XN+B/8FAO\n79ENy5LH+FGASESRhtq7clxjtfXBINg4WJzuAqF0REUxpcV+U5exESiyL8Eb\nsfXYgcsZIvqGgotwJnswK969XQqMtu0GTolAGVaxR9pet+rien/GfySTMvHc\ncp3YG7VDLdiBpBWmiIdJLRwdNmwxtuZmsGV5FnHqBgaXyv0nCACP+e9KaTme\nVPul\r\n=K4oS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClwX5lBa9IWmzs/9PApUw2T9oXl0YRd56UEezPc8BgXgIhAKkzmubR9+q0srtcQn52dOU/DvS1qOteGxq6f1Oh/zA0"}],"size":18601,"noattachment":false,"key":"/level-js/-/level-js-6.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-js_6.0.0_1617997689424_0.4042403893537514"},"_hasShrinkwrap":false,"readme":"# level-js\n\n> An [`abstract-leveldown`][abstract-leveldown] compliant store on top of [IndexedDB][indexeddb].\n\n[![level badge][level-badge]][awesome]\n[![npm](https://img.shields.io/npm/v/level-js.svg)](https://www.npmjs.com/package/level-js)\n[![Test](https://img.shields.io/github/workflow/status/Level/level-js/Test?label=test)](https://github.com/Level/level-js/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/level-js?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/level-js)\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## Table of Contents\n\n<details><summary>Click to expand</summary>\n\n- [Background](#background)\n- [Example](#example)\n- [Browser Support](#browser-support)\n- [Type Support](#type-support)\n- [Install](#install)\n- [API](#api)\n  - [`db = leveljs(location[, options])`](#db--leveljslocation-options)\n    - [`options`](#options)\n- [Big Thanks](#big-thanks)\n- [Contributing](#contributing)\n- [Donate](#donate)\n- [License](#license)\n\n</details>\n\n## Background\n\nHere are the goals of `level-js`:\n\n- Store large amounts of data in modern browsers\n- Pass the full [`abstract-leveldown`][abstract-leveldown] test suite\n- Support string and [`Buffer`][buffer] keys and values\n- Be as fast as possible\n- ~~Sync with [multilevel](https://github.com/juliangruber/multilevel) over ASCII or binary transports.~~\n\nBeing `abstract-leveldown` compliant means you can use many of the [Level modules][awesome] on top of this library.\n\n## Example\n\n**If you are upgrading:** please see [UPGRADING.md](UPGRADING.md).\n\n```js\nconst levelup = require('levelup')\nconst leveljs = require('level-js')\nconst db = levelup(leveljs('bigdata'))\n\ndb.put('hello', Buffer.from('world'), function (err) {\n  if (err) throw err\n\n  db.get('hello', function (err, value) {\n    if (err) throw err\n\n    console.log(value.toString()) // 'world'\n  })\n})\n```\n\nWith `async/await`:\n\n```js\nconst levelup = require('levelup')\nconst leveljs = require('level-js')\nconst db = levelup(leveljs('bigdata'))\n\nawait db.put('hello', Buffer.from('world'))\nconst value = await db.get('hello')\n```\n\n## Browser Support\n\n[![Sauce Test Status](https://app.saucelabs.com/browser-matrix/level-js.svg)](https://app.saucelabs.com/u/level-js)\n\n## Type Support\n\nKeys and values can be a string or [`Buffer`][buffer]. Any other type will be irreversibly stringified. The only exceptions are `null` and `undefined`. Keys and values of that type are rejected.\n\nIn order to sort string and Buffer keys the same way, for compatibility with `leveldown` and the larger ecosystem, `level-js` internally converts keys and values to binary before passing them to IndexedDB.\n\nIf you desire non-destructive encoding (e.g. to store and retrieve numbers as-is), wrap `level-js` with [`encoding-down`][encoding-down]. Alternatively install [`level`][level] which conveniently bundles [`levelup`][levelup], `level-js` and `encoding-down`. Such an approach is also recommended if you want to achieve universal (isomorphic) behavior. For example, you could have [`leveldown`][leveldown] in a backend and `level-js` in the frontend. The `level` package does exactly that.\n\nWhen getting or iterating keys and values, regardless of the type with which they were stored, keys and values will return as a Buffer unless the `asBuffer`, `keyAsBuffer` or `valueAsBuffer` options are set, in which case strings are returned. Setting these options is not needed when `level-js` is wrapped with `encoding-down`, which determines the optimal return type by the chosen encoding.\n\n```js\ndb.get('key', { asBuffer: false })\ndb.iterator({ keyAsBuffer: false, valueAsBuffer: false })\n```\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install level-js\n```\n\nNot to be confused with [leveljs](https://www.npmjs.com/package/leveljs).\n\nThis library is best used with [browserify](http://browserify.org).\n\n## API\n\n### `db = leveljs(location[, options])`\n\nReturns a new `leveljs` instance. `location` is the string name of the [`IDBDatabase`](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) to be opened, as well as the object store within that database. The database name will be prefixed with `options.prefix`.\n\n#### `options`\n\nThe optional `options` argument may contain:\n\n- `prefix` _(string, default: `'level-js-'`)_: Prefix for `IDBDatabase` name.\n- `version` _(string | number, default: `1`)_: The version to open the database with.\n\nSee [`IDBFactory#open`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open) 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## Contributing\n\n[`Level/level-js`](https://github.com/Level/level-js) 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[buffer]: https://nodejs.org/api/buffer.html\n\n[awesome]: https://github.com/Level/awesome\n\n[abstract-leveldown]: https://github.com/Level/abstract-leveldown\n\n[levelup]: https://github.com/Level/levelup\n\n[leveldown]: https://github.com/Level/leveldown\n\n[level]: https://github.com/Level/level\n\n[encoding-down]: https://github.com/Level/encoding-down\n","publish_time":1617997689580,"deprecated":"Superseded by browser-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1617997689580,"dist-tags":{"latest":"6.1.0","latest-4":"4.0.2"}}