{"name":"level-ws","version":"4.0.0","description":"A basic writable stream for abstract-level databases","license":"MIT","main":"level-ws.js","scripts":{"test":"standard && hallmark && nyc node test.js","coverage":"nyc report -r lcovonly"},"dependencies":{"readable-stream":"^4.0.0"},"devDependencies":{"hallmark":"^4.1.0","level":"^8.0.0","nyc":"^15.1.0","secret-event-listener":"^1.0.0","standard":"^17.0.0","tape":"^5.0.1","tempy":"^1.0.1"},"repository":{"type":"git","url":"git+https://github.com/Level/level-ws.git"},"homepage":"https://github.com/Level/level-ws","keywords":["level","leveldb","stream","levelup"],"engines":{"node":">=12"},"gitHead":"ee47b7903a02affd445cd28d892d08d4562c3bc7","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@4.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-agBO0OUZb8i7c0nN8czMduKfLaUcQzqbnCv1Dmm0I6RB09aVUtB/YqbO1oYSKO1ROazAA4Is6BEYpG4IVDgFIg==","shasum":"257cd48c0054d5ed1eeaf317443d83fadebd1161","tarball":"http://registry-npm.ywwl.com/level-ws/download/level-ws-4.0.0.tgz","fileCount":6,"unpackedSize":17022,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtXxQYHpmvwpT22kBFF7XhaibtfGW5yaci7hu9FYCaDAiEA+HffATrivsonFZ4Ban06BqpgBqaDLJ6tJeIDoiTenko="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivzoqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKjw//S28wnNyJvpQYm9H+nx1dItOBiS3Ni6BC58zSKl6oDnYIGedv\r\nRO1dYLe/MnGd8zvHg7PwpG6Fqgtq+b1fHo5ewbdLqklIN+Eb36dXspDOFAjB\r\nqVjxCC8Q+BQ6svmdhnr/1Pyai8jwKc/YHlyW2bJN6WSuuOtuch6hrgenHV1Z\r\nhM2PzyNEF8o01nI5MCwfWxD2sPA4ZASzA1abUK92q5Y0fvgfHGdv+lxWSvQt\r\nWmioc0ZzMQan/LIA945raiRlIkJDq+NBNgAFkdB9k3fW8mTVIVLI1oG5+vGp\r\nSe/ixdOYrIuocpWrfCQ6WpNX92nOI+LoZznqNdmKYSRjVpU6F14EBRGHwprl\r\nZ+0ZKO6DWNAiVirTmflG+Qda47k/JdmV7It8/ZkW+66jaXWexNmEDw5DfL7P\r\nEXnYbXTPb7loku6SWjuKs/FT70TTZFV1lZ11tWQCmuklNXMkbAU0GPfXL6DB\r\nfMgm+FVK75cZIkHaGQvF62mN+JLElFqOnUFqOImw0gOqib3BMEiHEZSpXLVi\r\nmnDU4Kb7J53cjKhhv+Q7mOFH0ei7Fw/skAPxKlmKIte9j6GGrUgwk5YkLutc\r\nOxJsaNAu3EB4QvDHYSSpWNvLYrAJ1pv5mPWqkoLGyDjrjW9V28nuEJZkMSG3\r\nX4tQW0dXPTWqlGbjwIQycY4fWXtCOLs7kWM=\r\n=X2VJ\r\n-----END PGP SIGNATURE-----\r\n","size":5599,"noattachment":false,"key":"/level-ws/-/level-ws-4.0.0.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"},{"name":"rvagg","email":"r@va.gg"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-ws_4.0.0_1656699433793_0.2516108670507906"},"_hasShrinkwrap":false,"readme":"# level-ws\n\n**A basic writable stream for [`abstract-level`](https://github.com/Level/abstract-level) databases, using Node.js core streams.** This is not a high-performance stream. If benchmarking shows that your particular usage does not fit then try one of the alternative writable streams that are optimized for different use cases.\n\n> :pushpin: To instead write data using Web Streams, see [`level-web-stream`](https://github.com/Level/web-stream).\n\n[![level badge][level-badge]](https://github.com/Level/awesome)\n[![npm](https://img.shields.io/npm/v/level-ws.svg)](https://www.npmjs.com/package/level-ws)\n[![Node version](https://img.shields.io/node/v/level-ws.svg)](https://www.npmjs.com/package/level-ws)\n[![Test](https://img.shields.io/github/workflow/status/Level/level-ws/Test?label=test)](https://github.com/Level/level-ws/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/Level/level-ws?label=\\&logo=codecov\\&logoColor=fff)](https://codecov.io/gh/Level/level-ws)\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## Usage\n\n_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._\n\n```js\nconst { Level } = require('level')\nconst WriteStream = require('level-ws')\n\nconst db = new Level('./db', { valueEncoding: 'json' })\nconst ws = new WriteStream(db)\n\nws.on('close', function () {\n  console.log('Done!')\n})\n\nws.write({ key: 'alice', value: 42 })\nws.write({ key: 'bob', value: 7 })\n\n// To delete entries, specify an explicit type\nws.write({ type: 'del', key: 'tomas' })\nws.write({ type: 'put', key: 'sara', value: 16 })\n\nws.end()\n```\n\n## API\n\n### `ws = new WriteStream(db[, options])`\n\nCreate a [writable stream](https://nodejs.org/dist/latest-v18.x/docs/api/stream.html#stream_class_stream_writable) that operates in object mode, accepting batch operations to be committed with `db.batch()` on each tick of the Node.js event loop. The optional `options` argument may contain:\n\n- `type` (string, default: `'put'`): default batch operation type if not set on indididual operations.\n- `maxBufferLength` (number, default `Infinity`): limit the size of batches. When exceeded, the stream will stop processing writes until the current batch has been committed.\n- `highWaterMark` (number, default `16`): buffer level when `stream.write()` starts returning false.\n\n## Contributing\n\n[`Level/level-ws`](https://github.com/Level/level-ws) 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## License\n\n[MIT](LICENSE)\n\n[level-badge]: https://leveljs.org/img/badge.svg\n","publish_time":1656699433975,"_cnpm_publish_time":1656699433975,"dist-tags":{"latest":"4.0.0"}}