{"name":"level","version":"10.0.0","keywords":["level","leveldb","stream","database","db","store","storage","json"],"license":"MIT","_id":"level@10.0.0","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"},{"name":"rvagg","email":"r@va.gg"},{"name":"ralphtheninja","email":"lms@linkping.org"}],"homepage":"https://github.com/Level/level","bugs":{"url":"https://github.com/Level/level/issues"},"dist":{"shasum":"60ced77f7b2afdcc0e4249ac283dd3170f54e39b","tarball":"http://registry-npm.ywwl.com/level/download/level-10.0.0.tgz","fileCount":8,"integrity":"sha512-aZJvdfRr/f0VBbSRF5C81FHON47ZsC2TkGxbBezXpGGXAUEL/s6+GP73nnhAYRSCIqUNsmJjfeOF4lzRDKbUig==","signatures":[{"sig":"MEUCIHBjOYWuIfVuoU70iOJPi8auemyCgsfuI0SklRZuo7eEAiEAxyjeiskQmMi2pCWdeFW/pYSIb5IIurQDMm/0jl9xr5k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53313,"size":14426,"noattachment":false,"key":"/level/-/level-10.0.0.tgz"},"main":"index.js","types":"./index.d.ts","browser":"browser.js","engines":{"node":">=18"},"funding":{"url":"https://opencollective.com/level","type":"opencollective"},"gitHead":"93b43ae8cc23cd499e4022a56f7969d804510a60","scripts":{"test":"standard && nyc node test.js","coverage":"nyc report -r lcovonly","test-browsers-local":"airtap --coverage test.js && nyc report"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"repository":{"url":"git+https://github.com/Level/level.git","type":"git"},"_npmVersion":"10.8.2","description":"Universal abstract-level database for Node.js and browsers","directories":{},"_nodeVersion":"22.7.0","dependencies":{"browser-level":"^3.0.0","classic-level":"^3.0.0","abstract-level":"^3.1.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","tape":"^5.9.0","uuid":"^11.1.0","airtap":"^5.0.0","babelify":"^10.0.0","hallmark":"^5.0.1","standard":"^17.1.2","typescript":"^5.7.2","@types/node":"^22.10.1","@babel/preset-env":"^7.26.9","airtap-playwright":"^1.0.1","@voxpelli/tsconfig":"^15.1.0"},"_npmOperationalInternal":{"tmp":"tmp/level_10.0.0_1745180976522_0.6135217142127016","host":"s3://npm-registry-packages-npm-production"},"readme":"# level\n\n**Universal [`abstract-level`](https://github.com/Level/abstract-level) database for Node.js and browsers.** This is a convenience package that exports [`classic-level`](https://github.com/Level/classic-level) in Node.js and [`browser-level`](https://github.com/Level/browser-level) in browsers, making it an ideal entry point to start creating lexicographically sorted key-value databases.\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]](https://github.com/Level/awesome)\n[![npm](https://img.shields.io/npm/v/level.svg)](https://www.npmjs.com/package/level)\n[![Node version](https://img.shields.io/node/v/level.svg)](https://www.npmjs.com/package/level)\n[![Test](https://img.shields.io/github/actions/workflow/status/Level/level/test.yml?branch=master&label=test)](https://github.com/Level/level/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/level?label=\\&logo=codecov\\&logoColor=fff)](https://codecov.io/gh/Level/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[![Community](https://img.shields.io/badge/community-join-%2370B99E?logo=github)](https://github.com/Level/community/issues)\n[![Donate](https://img.shields.io/badge/donate-orange?logo=open-collective\\&logoColor=fff)](https://opencollective.com/level)\n\n## Usage\n\n_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._\n\n```js\nconst { Level } = require('level')\n\n// Create a database\nconst db = new Level('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\nTypeScript type declarations are included and cover the methods that are common between `classic-level` and `browser-level`. Usage from TypeScript requires generic type parameters.\n\n<details><summary>TypeScript example</summary>\n\n```ts\n// Specify types of keys and values (any, in the case of json).\n// The generic type parameters default to Level<string, string>.\nconst db = new Level<string, any>('./db', { valueEncoding: 'json' })\n\n// All relevant methods then use those types\nawait db.put('a', { x: 123 })\n\n// Specify different types when overriding encoding per operation\nawait db.get<string, string>('a', { valueEncoding: 'utf8' })\n\n// Though in some cases TypeScript can infer them\nawait db.get('a', { valueEncoding: db.valueEncoding('utf8') })\n\n// It works the same for sublevels\nconst abc = db.sublevel('abc')\nconst xyz = db.sublevel<string, any>('xyz', { valueEncoding: 'json' })\n```\n\n</details>\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install level\n```\n\nFor use in browsers, this package is best used with [`browserify`](https://github.com/browserify/browserify), [`webpack`](https://webpack.js.org/), [`rollup`](https://rollupjs.org/) or similar bundlers. For a quick start, visit [`browserify-starter`](https://github.com/Level/browserify-starter) or [`webpack-starter`](https://github.com/Level/webpack-starter).\n\n## Supported Platforms\n\nAt the time of writing, `level` works in Node.js 18+ and Electron 30+ on Linux, Mac OS and Windows, including any future Node.js and Electron release thanks to [Node-API](https://nodejs.org/api/n-api.html), including ARM platforms like Raspberry Pi and Android, as well as in Chromium, Firefox and Safari. For details, see [Supported Platforms](https://github.com/Level/classic-level#supported-platforms) of `classic-level` and [Browser Support](https://github.com/Level/browser-level#browser-support) of `browser-level`.\n\nBinary keys and values are supported across the board.\n\n## API\n\nThe API of `level` follows that of [`abstract-level`](https://github.com/Level/abstract-level). For additional options and methods specific to [`classic-level`](https://github.com/Level/classic-level) or [`browser-level`](https://github.com/Level/browser-level), please see their respective READMEs. The documentation below only covers the common constructor.\n\n### `db = new Level(location[, options])`\n\nCreate a new database or open an existing database. The `location` argument must be a directory path (relative or absolute) where LevelDB will store its files, or in browsers, the name of the [`IDBDatabase`](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) to be opened.\n\n## Contributing\n\n[`Level/level`](https://github.com/Level/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","publish_time":1745180976726,"_cnpm_publish_time":1745180976726,"dist-tags":{"latest":"10.0.0","next":"5.0.0-0"}}