{"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","tarball":"http://registry-npm.ywwl.com/level-ws/download/level-ws-0.1.0.tgz","integrity":"sha512-YlWbD7feUlvnI4Gm1khvsY59YhHk3ur/IZ1iywLqplBOfW2efwm9c6tn1jJcBYhHPUPEDNJxjXHtF3ksL2IXRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDelJbVW1f8Bneu4rY8YpOf/4qcLGwCEK9PTChzQM8FWQIgc+ggMmYFiGYkdNdRm/1RCRSM/qCGpZUDU3WZbPVuVQQ="}],"size":7334,"noattachment":false,"key":"/level-ws/-/level-ws-0.1.0.tgz"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},{"name":"rvagg","email":"rod@vagg.org"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/level-ws-0.1.0.tgz_1491579294813_0.9250076168682426"},"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":1491579295500,"_cnpm_publish_time":1491579295500,"dist-tags":{"latest":"4.0.0"}}