{"name":"flush-write-stream","version":"1.0.0","description":"A write stream constructor that supports a flush function that is called before finish is emitted","main":"index.js","dependencies":{"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":"50e81d8eeee8a9666c7d5105775a6c89b7ae9dfa","_id":"flush-write-stream@1.0.0","_shasum":"cc4fc24f4b4c973f80027f27cc095841639965a7","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"cc4fc24f4b4c973f80027f27cc095841639965a7","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.0.0.tgz","integrity":"sha512-lJVfseDbQKqM4uQ3+VPD1g++SK0hgGjIk8KuD0+iREJxZ/VipbQhNi1zNFiTpuJ6veXepfgdTBfrGnuk7qcL+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk75W8BGEl2RPrVyEDrWmVQcXByK4Dtoo4YO2RH3+AgwIgAfWsKyP5CyrfJkAqJdZRAnllwc7iPo1u+VrW0LyMoxc="}],"size":2475,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"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":1446847023152,"_cnpm_publish_time":1446847023152,"dist-tags":{"latest":"2.0.0"}}