{"name":"level-js","version":"3.0.0","description":"An abstract-leveldown compliant store on top of IndexedDB","author":{"name":"max ogden"},"license":"MIT","main":"index.js","scripts":{"test":"standard && airtap --local --no-coverage test/index.js","test-browsers":"standard && airtap --sauce-connect --loopback airtap.local --no-coverage test/index.js","remark":"remark README.md CONTRIBUTORS.md CHANGELOG.md UPGRADING.md -o"},"files":["index.js","iterator.js","util","CONTRIBUTORS.md","CHANGELOG.md","UPGRADING.md","sauce-labs.svg"],"browser":{"./util/immediate.js":"./util/immediate-browser.js"},"standard":{"ignore":["test/util/idb-shim.js"]},"dependencies":{"abstract-leveldown":"~5.0.0","immediate":"~3.2.3","inherits":"^2.0.3","ltgt":"^2.1.2","typedarray-to-buffer":"~3.1.5"},"devDependencies":{"airtap":"0.0.7","buffer":"~5.1.0","level-community":"~3.0.0","remark-cli":"^5.0.0","remark-collapse":"~0.1.2","remark-git-contributors":"~0.2.1","remark-github":"~7.0.3","remark-toc":"~5.0.0","standard":"^11.0.1","tape":"^4.0.0"},"remarkConfig":{"plugins":[["remark-git-contributors","level-community"],["remark-github"],["remark-toc",{"maxDepth":2,"tight":true}],["remark-collapse",{"test":"Table of Contents","summary":"Click to expand"}]]},"repository":{"type":"git","url":"git+https://github.com/Level/level-js.git"},"keywords":["level","leveldb","indexeddb","abstract-leveldown"],"gitHead":"296cfe0bed6592343c8d0d482a9eb18d510e4c85","bugs":{"url":"https://github.com/Level/level-js/issues"},"homepage":"https://github.com/Level/level-js#readme","_id":"level-js@3.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"email":"james.kyburz@gmail.com","name":"jameskyburz"},{"email":"julian@juliangruber.com","name":"juliangruber"},{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"max@maxogden.com","name":"maxogden"},{"email":"nolan@nolanlawson.com","name":"nolanlawson"},{"email":"ralphtheninja@riseup.net","name":"ralphtheninja"},{"email":"dev@vincentweevers.nl","name":"vweevers"}],"dist":{"integrity":"sha512-e2dVpjCWNwIcyboZUsLqx2vERM0I5OPZOE9wfD22fk8b8OeuZRoV4scr0Y+YIyDXE5cwOsO/1LyjsdJ36o+9Ag==","shasum":"e6c066fb529b23eec230849c0751e4f6d548c865","tarball":"http://registry-npm.ywwl.com/level-js/download/level-js-3.0.0.tgz","fileCount":13,"unpackedSize":57422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJsbhCRA9TVsSAnZWagAA2GoP/iQKlPt7L5yWTwCSkEBV\nBBgHfVqdJe3rTGKWKdb78GzzXXzDBVKLSYn2KK23rVjkfv/KwCG60/OerGnf\nmJAFSL6iHxdhgh/Q31zk/H2JYokoxd1QO//xhsGDh/ZYoyXiWzJcIGwuIujR\nehenpT14M3JZMetYAJK4oYfk1yFHrinXOLVsUz5IiaVV/1fTkELWls5ktjBS\n99zOQJ+djLyZEnk8b1iXcN4vo6JpP/SqFiuW17W3VjHmA7wV45wtJ4LTcV+w\nOO9Lsdh47Ui81o5RPidF9qed6NxqFDOyGeFt6bO+YLB+2GHjA0LNViG6UVdl\nyAPA4Vlx8siXpj03c0UYiRT7jQ7auTkjTg2xj8EY9kQYsZWZZXHpex1XzCFC\nS+cYHSN2gV2cp0AxzjPV2azN3q50/0FyeqqMcfmqiFCshRxXjKskZjA9ZqYP\nuXR/XOCZbWI6jO+Y30xaDg2p2BccXHDV7V7D2upeqUKqorIaWrLnHo4MxFdo\na0c+nOEtQ2Vwh8tmxIEASCPnSEiXnIXDxXVYTh9lYIHF+K5mekmfvXEfSRzp\ni2VZxmQZGucKeDJZ4qJOgeG+Gl/78xZHgvGWusgIaAAywUG++r1Bzs9TzQiI\nIlGsf8jJ5XdEubvWrxPYyFEwclPA7RoqSiZSVBXCmlVJ8MCQVAVoRgd0HE2S\nYBMR\r\n=MNMC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHMOGf4ZoMLgJSm/iR6q7oZf0n9cdERs8TjuomNDCNJAiAIUIrttxlOzM7fIBlHfXHm+fis+WDUk8gYvMhpwv5pmQ=="}],"size":16076,"noattachment":false,"key":"/level-js/-/level-js-3.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-js_3.0.0_1529267935433_0.7426455616994514"},"_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":1529267935548,"deprecated":"Superseded by browser-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1529267935548,"dist-tags":{"latest":"6.1.0","latest-4":"4.0.2"}}