{"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","tarball":"http://registry-npm.ywwl.com/level-ws/download/level-ws-0.0.1.tgz","integrity":"sha512-lJaNP73F7Tb+J3CMqtaI4Vob6G5ctxGI0JjnBVYOKc5Ro0AIYoBscuK/UU1b5pEfKDSh6IVBnI9abTdygB+BEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0JzNwHhvLOtjSPzI/+jd/e+fJQqBpdpAwN3MAWugkFAiA+b4tixCU5HLMQsrEeZ08+yIg+uArtsxe1fL60RlRoOQ=="}],"size":7312,"noattachment":false,"key":"/level-ws/-/level-ws-0.0.1.tgz"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},{"name":"rvagg","email":"rod@vagg.org"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/level-ws-0.0.1.tgz_1458071710073_0.4518034884240478"},"directories":{},"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":1458071712265,"_cnpm_publish_time":1458071712265,"dist-tags":{"latest":"4.0.0"}}