{"name":"level-js","version":"4.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 --local --coverage test/index.js","test-browsers":"standard && airtap --sauce-connect --loopback airtap.local --coverage test/index.js","coverage":"nyc report --reporter=text-lcov | coveralls","hallmark":"hallmark --fix"},"browser":{"./util/immediate.js":"./util/immediate-browser.js"},"dependencies":{"abstract-leveldown":"~6.0.1","immediate":"~3.2.3","inherits":"^2.0.3","ltgt":"^2.1.2","typedarray-to-buffer":"~3.1.5"},"devDependencies":{"airtap":"^2.0.0","coveralls":"^3.0.2","hallmark":"0.1.0","level-community":"~3.0.0","level-concat-iterator":"^2.0.0","nyc":"^13.1.0","standard":"^12.0.1","tape":"^4.0.0","uuid":"~3.3.2"},"hallmark":{"community":"level-community"},"repository":{"type":"git","url":"git+https://github.com/Level/level-js.git"},"keywords":["level","leveldb","indexeddb","abstract-leveldown"],"gitHead":"830f5b7b7bb718b1275cf0d9cd5a2021a57f68f0","bugs":{"url":"https://github.com/Level/level-js/issues"},"homepage":"https://github.com/Level/level-js#readme","_id":"level-js@4.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.14.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-V+3MDBLYPQ+Fe6FybF69X6CgLw8lE6feL+p0aRSWaEB3x/VsNpeJ1xsbT/LoV1zrcfSDBuQBuI/Hqwn0FxBahw==","shasum":"1dc3e27ea29de99d549ac62a492862aa0c8186db","tarball":"http://registry-npm.ywwl.com/level-js/download/level-js-4.0.0.tgz","fileCount":13,"unpackedSize":63825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKOoOCRA9TVsSAnZWagAA2acP/0UDWkz6To8seBr/Um2G\nexR4g0kIkhYC8If4fMMGlZv6+sVDHtA4PiY/ZzBEctpbjtTmRSl6Hopm1Rl7\n2I8zohW0xc61bME2afU1C32tMTXISC1LsqRAIn/zjUbCpaCeZv0rzZIAi3rl\nNSNB3Yz13KAIcW+YFdiiUwPdwEw/tb1qoufC84+DbI9mvZzOuoMXjLZTyLzD\nVExvmeaZRQNk/lFqjrtRGLPZN8U8J7W2uf6t+xeNbw+Ui/MCDDWepBxVWuR4\ntPMmjUEkfPo+pR4CRBHrjSnNdI7KC45vDkZHV+VSA9LlBHG92am7c4UZFx2Q\nKubJzBWpl23QVnFen8AamtAYiry5t5740gFUAkv1WVxlD/kd7eLYLbqOxjq+\npnDQU5UHzC2PpOkkelWyXKRwtfISsEvdgzRKomyl6tIttxMgNj618dWy26Fl\n2OXhb7zpnNGD737Tg1Q9r3S8JJ2srRgnD1ZcZ3rSZe1/juC/ouBvZruTByrV\njJA//nMoqJrTyXLt8vG/lqjftYPtJUIZSD/1RgoI83vsQS4G6OYk5nom/C4O\n+CUZNEGRpDo1OjMAsRFeODAfn/4p93bKvh5PjqulHhQ7jPfyJUUkFZQrqHFg\n0u2VUAMaUQK85hda0Y+yIGFFl1pQZMFSDiRpQ0y1oDwF5ppK9OhD+jji5ZeZ\n4z/n\r\n=OH51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaihZOc0HaxFkDr/JE7saSMjsp2aS5+Bg46ZPpQqiplwIgEqlUmhMykzoNNccizlvOiVCTW6onPalysaZeo7z6uFI="}],"size":18003,"noattachment":false,"key":"/level-js/-/level-js-4.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-js_4.0.0_1546185229914_0.47475601761013575"},"_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":1546185230043,"deprecated":"Superseded by browser-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1546185230043,"dist-tags":{"latest":"6.1.0","latest-4":"4.0.2"}}