{"_id":"level-ws","_rev":"4579879","name":"level-ws","description":"A basic writable stream for abstract-level databases","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"time":{"modified":"2026-04-10T15:56:23.000Z","created":"2013-10-12T09:07:24.763Z","4.0.0":"2022-07-01T18:17:13.975Z","3.0.0":"2021-04-25T12:42:20.552Z","2.0.0":"2019-03-30T18:43:33.498Z","1.0.0":"2018-06-30T21:03:56.706Z","0.1.0":"2017-04-07T15:34:55.500Z","0.0.1":"2016-03-15T19:55:12.265Z","0.0.0":"2013-10-12T09:07:24.763Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/Level/level-ws.git"},"versions":{"4.0.0":{"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":{"shasum":"257cd48c0054d5ed1eeaf317443d83fadebd1161","size":5599,"noattachment":false,"key":"/level-ws/-/level-ws-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-4.0.0.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-ws_4.0.0_1656699433793_0.2516108670507906"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-02T13:26:13.923Z","publish_time":1656699433975,"_cnpm_publish_time":1656699433975},"3.0.0":{"name":"level-ws","version":"3.0.0","description":"A basic WriteStream implementation for LevelUP","license":"MIT","main":"level-ws.js","scripts":{"test":"standard && hallmark && nyc node test.js","coverage":"nyc report -r lcovonly","hallmark":"hallmark --fix","dependency-check":"dependency-check . test.js","prepublishOnly":"npm run dependency-check"},"dependencies":{"inherits":"^2.0.3","readable-stream":"^3.1.0"},"devDependencies":{"dependency-check":"^3.3.0","hallmark":"^3.1.0","level":"^7.0.0","level-concat-iterator":"^3.0.0","nyc":"^15.1.0","secret-event-listener":"^1.0.0","standard":"^16.0.3","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":">=10"},"gitHead":"7bd4c984785b6be225e3e3d06fe28463a43dc1a6","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@3.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"dist":{"shasum":"36a2048cd952b4201b2ef08800621a3d787bb1ec","size":6042,"noattachment":false,"key":"/level-ws/-/level-ws-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-3.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-ws_3.0.0_1619354540430_0.8664665218705825"},"_hasShrinkwrap":false,"publish_time":1619354540552,"_cnpm_publish_time":1619354540552},"2.0.0":{"name":"level-ws","version":"2.0.0","description":"A basic WriteStream implementation for LevelUP","license":"MIT","main":"level-ws.js","scripts":{"test":"standard && hallmark && nyc node test.js","coverage":"nyc report --reporter=text-lcov | coveralls","hallmark":"hallmark --fix","dependency-check":"dependency-check . test.js","prepublishOnly":"npm run dependency-check"},"dependencies":{"inherits":"^2.0.3","readable-stream":"^3.1.0","xtend":"^4.0.1"},"devDependencies":{"coveralls":"^3.0.1","dependency-check":"^3.3.0","hallmark":"^0.1.0","level":"^5.0.1","level-community":"^3.0.0","level-concat-iterator":"^2.0.0","nyc":"^13.2.0","secret-event-listener":"^1.0.0","standard":"^12.0.0","tape":"^4.9.0","tempy":"^0.2.1"},"hallmark":{"community":"level-community","ignore":["CONTRIBUTORS.md"]},"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":">=6"},"gitHead":"55880557e10e2e5a6ed4d85edac36c122a4fa3a3","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"dist":{"shasum":"207a07bcd0164a0ec5d62c304b4615c54436d339","size":8913,"noattachment":false,"key":"/level-ws/-/level-ws-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-2.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-ws_2.0.0_1553971413278_0.8920108894439835"},"_hasShrinkwrap":false,"publish_time":1553971413498,"_cnpm_publish_time":1553971413498},"1.0.0":{"name":"level-ws","description":"A basic WriteStream implementation for LevelUP","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/Level/level-ws.git"},"homepage":"https://github.com/Level/level-ws","keywords":["leveldb","stream","levelup"],"main":"level-ws.js","dependencies":{"inherits":"^2.0.3","readable-stream":"^2.2.8","xtend":"^4.0.1"},"devDependencies":{"coveralls":"~3.0.1","level":"^4.0.0","level-concat-iterator":"^2.0.0","nyc":"~12.0.2","secret-event-listener":"~1.0.0","standard":"^11.0.1","tape":"^4.9.0","tempy":"^0.2.1"},"scripts":{"test":"standard && nyc node test.js","coverage":"nyc report --reporter=text-lcov | coveralls"},"license":"MIT","engines":{"node":">=6"},"gitHead":"3e2bcab3c5470c71d692629aea8731c3b067d461","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@1.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.5.0","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"dist":{"shasum":"19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b","size":8101,"noattachment":false,"key":"/level-ws/-/level-ws-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-1.0.0.tgz"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-ws_1.0.0_1530392636660_0.6933303311859591"},"_hasShrinkwrap":false,"publish_time":1530392636706,"_cnpm_publish_time":1530392636706},"0.1.0":{"name":"level-ws","description":"A basic WriteStream implementation for LevelUP","version":"0.1.0","contributors":[{"name":"Rod Vagg","email":"r@va.gg","url":"https://github.com/rvagg"},{"name":"John Chesley","email":"john@chesl.es","url":"https://github.com/chesles/"},{"name":"Jake Verbaten","email":"raynos2@gmail.com","url":"https://github.com/raynos"},{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"https://github.com/dominictarr"},{"name":"Max Ogden","email":"max@maxogden.com","url":"https://github.com/maxogden"},{"name":"Lars-Magnus Skog","email":"ralphtheninja@riseup.net","url":"https://github.com/ralphtheninja"},{"name":"David Björklund","email":"david.bjorklund@gmail.com","url":"https://github.com/kesla"},{"name":"Julian Gruber","email":"julian@juliangruber.com","url":"https://github.com/juliangruber"},{"name":"Paolo Fragomeni","email":"paolo@async.ly","url":"https://github.com/hij1nx"},{"name":"Anton Whalley","email":"anton.whalley@nearform.com","url":"https://github.com/No9"},{"name":"Matteo Collina","email":"matteo.collina@gmail.com","url":"https://github.com/mcollina"},{"name":"Pedro Teixeira","email":"pedro.teixeira@gmail.com","url":"https://github.com/pgte"},{"name":"James Halliday","email":"mail@substack.net","url":"https://github.com/substack"}],"repository":{"type":"git","url":"git+https://github.com/Level/level-ws.git"},"homepage":"https://github.com/Level/level-ws","keywords":["leveldb","stream","levelup"],"main":"level-ws.js","dependencies":{"readable-stream":"^2.2.8","xtend":"^4.0.0"},"devDependencies":{"tape":"*","level":"*","after":"*","rimraf":"*"},"scripts":{"test":"node test.js"},"license":"MIT","gitHead":"1daea82f4ddfac364f896fd681ae27c3271be295","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@0.1.0","_shasum":"9728f02f3e7f34607f05010c1e4a83242e90b0b2","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"dist":{"shasum":"9728f02f3e7f34607f05010c1e4a83242e90b0b2","size":7334,"noattachment":false,"key":"/level-ws/-/level-ws-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-0.1.0.tgz"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/level-ws-0.1.0.tgz_1491579294813_0.9250076168682426"},"directories":{},"publish_time":1491579295500,"_hasShrinkwrap":false,"_cnpm_publish_time":1491579295500},"0.0.1":{"name":"level-ws","description":"A basic WriteStream implementation for LevelUP","version":"0.0.1","contributors":[{"name":"Rod Vagg","email":"r@va.gg","url":"https://github.com/rvagg"},{"name":"John Chesley","email":"john@chesl.es","url":"https://github.com/chesles/"},{"name":"Jake Verbaten","email":"raynos2@gmail.com","url":"https://github.com/raynos"},{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"https://github.com/dominictarr"},{"name":"Max Ogden","email":"max@maxogden.com","url":"https://github.com/maxogden"},{"name":"Lars-Magnus Skog","email":"ralphtheninja@riseup.net","url":"https://github.com/ralphtheninja"},{"name":"David Björklund","email":"david.bjorklund@gmail.com","url":"https://github.com/kesla"},{"name":"Julian Gruber","email":"julian@juliangruber.com","url":"https://github.com/juliangruber"},{"name":"Paolo Fragomeni","email":"paolo@async.ly","url":"https://github.com/hij1nx"},{"name":"Anton Whalley","email":"anton.whalley@nearform.com","url":"https://github.com/No9"},{"name":"Matteo Collina","email":"matteo.collina@gmail.com","url":"https://github.com/mcollina"},{"name":"Pedro Teixeira","email":"pedro.teixeira@gmail.com","url":"https://github.com/pgte"},{"name":"James Halliday","email":"mail@substack.net","url":"https://github.com/substack"}],"repository":{"type":"git","url":"git+https://github.com/Level/level-ws.git"},"homepage":"https://github.com/Level/level-ws","keywords":["leveldb","stream","levelup"],"main":"level-ws.js","dependencies":{"readable-stream":"~2.0.6","xtend":"~2.1.1"},"devDependencies":{"tape":"*","level":"*","after":"*","rimraf":"*"},"scripts":{"test":"node test.js"},"license":"MIT","gitHead":"2a8e1bb818ceaf17576401bf2e49c2647ed6cf15","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@0.0.1","_shasum":"6826c224d2ff6a064adc3732b85df2e9464d28ea","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.1","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"dist":{"shasum":"6826c224d2ff6a064adc3732b85df2e9464d28ea","size":7312,"noattachment":false,"key":"/level-ws/-/level-ws-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-0.0.1.tgz"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/level-ws-0.0.1.tgz_1458071710073_0.4518034884240478"},"directories":{},"publish_time":1458071712265,"_cnpm_publish_time":1458071712265,"_hasShrinkwrap":false},"0.0.0":{"name":"level-ws","description":"A basic WriteStream implementation for LevelUP","version":"0.0.0","contributors":[{"name":"Rod Vagg","email":"r@va.gg","url":"https://github.com/rvagg"},{"name":"John Chesley","email":"john@chesl.es","url":"https://github.com/chesles/"},{"name":"Jake Verbaten","email":"raynos2@gmail.com","url":"https://github.com/raynos"},{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"https://github.com/dominictarr"},{"name":"Max Ogden","email":"max@maxogden.com","url":"https://github.com/maxogden"},{"name":"Lars-Magnus Skog","email":"lars.magnus.skog@gmail.com","url":"https://github.com/ralphtheninja"},{"name":"David Björklund","email":"david.bjorklund@gmail.com","url":"https://github.com/kesla"},{"name":"Julian Gruber","email":"julian@juliangruber.com","url":"https://github.com/juliangruber"},{"name":"Paolo Fragomeni","email":"paolo@async.ly","url":"https://github.com/hij1nx"},{"name":"Anton Whalley","email":"anton.whalley@nearform.com","url":"https://github.com/No9"},{"name":"Matteo Collina","email":"matteo.collina@gmail.com","url":"https://github.com/mcollina"},{"name":"Pedro Teixeira","email":"pedro.teixeira@gmail.com","url":"https://github.com/pgte"},{"name":"James Halliday","email":"mail@substack.net","url":"https://github.com/substack"}],"repository":{"type":"git","url":"https://github.com/Level/level-ws.git"},"homepage":"https://github.com/Level/level-ws","keywords":["leveldb","stream","levelup"],"main":"level-ws.js","dependencies":{"readable-stream":"~1.0.15","xtend":"~2.1.1"},"devDependencies":{"tape":"*","level":"*","after":"*","rimraf":"*"},"scripts":{"test":"node test.js"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/Level/level-ws/issues"},"_id":"level-ws@0.0.0","dist":{"shasum":"372e512177924a00424b0b43aef2bb42496d228b","size":7172,"noattachment":false,"key":"/level-ws/-/level-ws-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/level-ws/download/level-ws-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"rvagg","email":"rod@vagg.org"},"maintainers":[{"name":"ralphtheninja","email":""},{"name":"rvagg","email":""},{"name":"vweevers","email":""}],"directories":{},"publish_time":1381568844763,"_cnpm_publish_time":1381568844763,"_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","_attachments":{},"homepage":"https://github.com/Level/level-ws","bugs":{"url":"https://github.com/Level/level-ws/issues"},"license":"MIT"}