{"name":"flush-write-stream","version":"1.0.3","description":"A write stream constructor that supports a flush function that is called before finish is emitted","main":"index.js","dependencies":{"inherits":"^2.0.1","readable-stream":"^2.0.4"},"devDependencies":{"tape":"^4.2.2"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/flush-write-stream.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/flush-write-stream/issues"},"homepage":"https://github.com/mafintosh/flush-write-stream","gitHead":"3a0c6e62c7c9a5c22abf49cd1a06c960487fa2c9","_id":"flush-write-stream@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==","shasum":"c5d586ef38af6097650b49bc41b55fabb19f35bd","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.0.3.tgz","fileCount":7,"unpackedSize":6512,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdEjNI6bTwPtrfpd8o1hIC9mkggjkN+TVi22FB530tbAiAsCqWEr5CNkCRQVLl6OAXZMhIi0bp7rC6lhRwD25uD8w=="}],"size":2552,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.3.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.0.3_1521632961113_0.42985920051576776"},"_hasShrinkwrap":false,"readme":"# flush-write-stream\n\nA write stream constructor that supports a flush function that is called before `finish` is emitted\n\n```\nnpm install flush-write-stream\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/flush-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/flush-write-stream)\n\n## Usage\n\n``` js\nvar writer = require('flush-write-stream')\n\nvar ws = writer(write, flush)\n\nws.on('finish', function () {\n  console.log('finished')\n})\n\nws.write('hello')\nws.write('world')\nws.end()\n\nfunction write (data, enc, cb) {\n  // i am your normal ._write method\n  console.log('writing', data.toString())\n  cb()\n}\n\nfunction flush (cb) {\n  // i am called before finish is emitted\n  setTimeout(cb, 1000) // wait 1 sec\n}\n```\n\nIf you run the above it will produce the following output\n\n```\nwriting hello\nwriting world\n(nothing happens for 1 sec)\nfinished\n```\n\n## API\n\n#### `var ws = writer([options], write, [flush])`\n\nCreate a new writable stream. Options are forwarded to the stream constructor.\n\n#### `var ws = writer.obj([options], write, [flush])`\n\nSame as the above except `objectMode` is set to `true` per default.\n\n## License\n\nMIT\n","publish_time":1521632961221,"_cnpm_publish_time":1521632961221,"dist-tags":{"latest":"2.0.0"}}