{"name":"flush-write-stream","version":"1.0.2","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":"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":"d35a4071dacbcc60fc40d798fa58fc425cba3efc","_id":"flush-write-stream@1.0.2","_shasum":"c81b90d8746766f1a609a46809946c45dd8ae417","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c81b90d8746766f1a609a46809946c45dd8ae417","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.0.2.tgz","integrity":"sha512-PxjbUsJySYlyHjIUCdLp9ZYibN1HBrxsbumre7pmcx3KY6XtW7Ye7uYshZ+PkQO3FjCYf8UFwY7Fjce3XRanRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgrcgieuAe+b2cT2vuPTKYwceiv+3XId/VUiR0T3iu0AiEAo50Kcf1v6tDmjJ+Z9idrxkekWOriOaVdMSSb2D6A02I="}],"size":2602,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/flush-write-stream-1.0.2.tgz_1476614807882_0.22224654001183808"},"directories":{},"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":1476614809463,"_cnpm_publish_time":1476614809463,"dist-tags":{"latest":"2.0.0"}}