{"name":"subleveldown","version":"3.0.0-rc1","description":"sublevels implemented using leveldowns","main":"index.js","dependencies":{"abstract-leveldown":"^5.0.0","encoding-down":"^5.0.3","inherits":"^2.0.3","level-option-wrap":"^1.1.0","levelup":"^3.0.1"},"devDependencies":{"memdown":"^3.0.0","standard":"^11.0.1","tape":"^4.9.0"},"repository":{"type":"git","url":"git+https://github.com/level/subleveldown.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/level/subleveldown/issues"},"homepage":"https://github.com/level/subleveldown","directories":{"test":"test"},"scripts":{"test":"standard && node test"},"engines":{"node":">=6"},"readme":"# subleveldown\n\n> Sublevels on top of [`levelup`][levelup] with different encodings for each sublevel.\n\n[![level badge][level-badge]](https://github.com/level/awesome)\n[![npm](https://img.shields.io/npm/v/subleveldown.svg)](https://www.npmjs.com/package/subleveldown)\n![Node version](https://img.shields.io/node/v/subleveldown.svg)\n[![Travis](https://img.shields.io/travis/Level/subleveldown.svg?style=flat)](http://travis-ci.org/Level/subleveldown)\n[![dependencies](https://img.shields.io/david/Level/subleveldown.svg)](https://david-dm.org/level/subleveldown)\n[![npm](https://img.shields.io/npm/dm/subleveldown.svg)](https://www.npmjs.com/package/subleveldown)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Table of Contents\n\n<details><summary>Click to expand</summary>\n\n- [Usage](#usage)\n- [Background](#background)\n- [API](#api)\n- [Install](#install)\n- [License](#license)\n\n</details>\n\n## Usage\n\n**If you are upgrading:** please see [UPGRADING.md](UPGRADING.md).\n\n``` js\nvar sub = require('subleveldown')\nvar level = require('level')\n\nvar db = level('db')\n\nvar test = sub(db, 'test') // test is just a regular levelup\nvar test2 = sub(db, 'test2')\nvar nested = sub(test, 'nested')\n\ntest.put('hello', 'world', function() {\n  nested.put('hi', 'welt', function() {\n    // will print {key:'hello', value:'world'}\n    test.createReadStream().on('data', console.log)\n  })\n})\n```\n\n## Background\n\n`subleveldown` separates a [`levelup`][levelup] database into sections - or *sublevels* from here on out. Think SQL tables, but evented, ranged and realtime!\n\nEach sublevel is a `levelup` of its own. This means it has the exact same interface as its parent database, but its own keyspace and [events](https://github.com/Level/levelup#events). In addition, sublevels are individually wrapped with [`encoding-down`][encoding-down], giving us per-sublevel encodings. For example, it's possible to have one sublevel with Buffer keys and another with `'utf8'` encoded keys. The same goes for values. Like so:\n\n```js\nsub(db, 'one', { valueEncoding: 'json' })\nsub(db, 'two', { keyEncoding: 'binary' })\n```\n\nThere is one limitation, however: keys must *encode to* either strings or Buffers. This is not likely to affect you, unless you use custom encodings or the `id` encoding (which bypasses encodings and thus makes it your responsibility to ensure keys are either strings or Buffers).\n\nAuthored by [@mafintosh](https://github.com/mafintosh) and inspired by [`level-sublevel`][level-sublevel] by [@dominictarr](https://github.com/dominictarr), `subleveldown` has become an official part of [Level][level-org]. As `level-sublevel` is no longer under active development, we recommend switching to `subleveldown` to get the latest and greatest of the Level ecosystem. These two modules largely offer the same functionality, except for [hooks](https://github.com/dominictarr/level-sublevel#hooks) and [per-batch prefixes](https://github.com/dominictarr/level-sublevel#batches).\n\n## API\n\n### `subdb = sub(db[, prefix][, options])`\n\nReturns a `levelup` instance that uses subleveldown to prefix the keys of the underlying store of `db`. The required `db` parameter must be a `levelup` instance. Any layers that this instance may have (like `encoding-down` or `subleveldown` itself) are peeled off to get to the innermost [`abstract-leveldown`][abstract-leveldown] compliant store (like `leveldown`). This ensures there is no double encoding step.\n\nThe `prefix` must be a string. If omitted, the effective prefix is two separators, e.g. `'!!'`. If `db` is already a subleveldown-powered instance, the effective prefix is a combined prefix, e.g. `'!one!!two!'`.\n\nThe optional `options` parameter has the following `subleveldown` specific properties:\n\n* `separator` *(string, default: `'!'`)* Character for separating sublevel prefixes from user keys and each other. Should be outside the character (or byte) range of user keys.\n* `open` *(function)* Optional open hook called when the underlying `levelup` instance has been opened. The hook receives a callback which must be called to finish opening.\n\nAny other `options` are passed along to the underlying [`levelup`][levelup] and [`encoding-down`][encoding-down] constructors. See their documentation for further details.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm i subleveldown -S\n```\n\n## License\n\nMIT © 2014-present [Mathias Buus](https://github.com/mafintosh) and [contributors](https://github.com/Level/subleveldown/graphs/contributors). See the included [LICENSE](./LICENSE.md) file for more details.\n\n[level-badge]: http://leveldb.org/img/badge.svg\n[levelup]: https://github.com/level/levelup\n[encoding-down]: https://github.com/level/encoding-down\n[abstract-leveldown]: https://github.com/level/abstract-leveldown\n[level-sublevel]: https://github.com/dominictarr/level-sublevel\n[level-org]: https://github.com/Level\n","readmeFilename":"README.md","gitHead":"ca9b6b16f3f002ae648022ae96aa356db32c47c0","_id":"subleveldown@3.0.0-rc1","_npmVersion":"6.1.0","_nodeVersion":"10.1.0","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"dist":{"integrity":"sha512-PucxDi9rkU8ct30iMf/1vFvGrx1aFG9nUu8ZnebUu3+LRY14+CfFLVSRdSkywgWMNnUtwcdpUJ+HSTDIAEFj+g==","shasum":"7f395d0792c66faa3e8f3d1aa80bb78c4e329707","tarball":"http://registry-npm.ywwl.com/subleveldown/download/subleveldown-3.0.0-rc1.tgz","fileCount":11,"unpackedSize":24123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbE76TCRA9TVsSAnZWagAAfoEP/Rr/zC9TT6pyfyjEgq1V\nV0AdP9vddcmN2eYh0E0bwDWfJUddJSHOLQH5IvKriqLKhwhGSpWq7zVVjn2A\n7esedm9oFCvAIIGGjQz52JwRbEzggvyxvZJmfs55Ho8xS2n92EMgL6SvZWez\nk1uOEZaePHGwVuBbT2jhhpN68M1omdi52eiKv87ElaVNraNBgFYMGDWR4iBt\nNSJm0v2R6NaOYVjo8gH4d1xYWZdx1dYKmrecGFfiozie1+yW8SUm7ZyVDaap\n/YpO0fA5i3EYHFQVYD0yM1aFIYMjpMb3z1jdgoxM8fSg8VCDBAOMmRlW+6pX\nCdWQdQGNhKSyXIlxOdmDUyLkCjG2Ou8yYM6JHSWJ/dK7stQos6yiq5GiQhKz\nv3Z0d051xw2AY9tx17kXO32cbcuLkDUGisWuOlhvrPdpfU5VytD7KHQ63yPu\nv/TH/yEQJXF0bdxwn3BweQaZKOBy4fyijq1YpbrIA/jaWWG0ObEML7pE9QF7\nbPlrc8JE/dcm3H8gp7aBJ+mvTLOeFfIDyQOoBoOPGhOvlXmy6ClW3naLYS6g\n+ozmoSBcvMlonSMDEnK+f8PH7XhiFY7OQ2Njkqsul0mG077WO+romNHSGLo9\nbe2Mfcm6cus4qyyBHW58JcE8u1o4KaKUyrYfowndAW6ve30TLIoRaRQsk3Kk\neBZS\r\n=rZ4Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIM/Vyqc1Ad0btbre2g+vUBQ0y5tJ/CT/Da1hyuu/NRwIhAKD97xjqGifOOYqfncUzo+Ofl7EEMk4yp5qCuApYWaba"}],"size":7736,"noattachment":false,"key":"/subleveldown/-/subleveldown-3.0.0-rc1.tgz"},"maintainers":[{"email":"julian@juliangruber.com","name":"juliangruber"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"},{"email":"ralphtheninja@riseup.net","name":"ralphtheninja"},{"email":"dev@vincentweevers.nl","name":"vweevers"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/subleveldown_3.0.0-rc1_1528020626782_0.5434723920200979"},"_hasShrinkwrap":false,"publish_time":1528020626854,"deprecated":"Superseded by abstract-level (https://github.com/Level/community#faq)","_cnpm_publish_time":1528020626854,"dist-tags":{"latest":"6.0.1"}}