{"name":"flush-write-stream","version":"1.0.1","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":"7f00179b7018083158fdf58c416aaa77ed2696c3","_id":"flush-write-stream@1.0.1","_shasum":"39dd8e6627109b5e833461d1b1eeb25edff3c4ba","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"39dd8e6627109b5e833461d1b1eeb25edff3c4ba","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.0.1.tgz","integrity":"sha512-vfkvSH1cbIIR27IIG49k70Zeq0CYqiiwXZBgZRXL4Tans1tAmEsaQ/sY5vNrR/stAYoRcW9/tE3dySH7htvhfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrEZtg3IMO6ZvkfkEbQSL69+Bebdwz2+JIeAlxoFiAkAiBQFKPyyMKQsRx5DZLIkve+l6aROj/yfUecliGi3gdkXA=="}],"size":2577,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/flush-write-stream-1.0.1.tgz_1476614551011_0.6873086630366743"},"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":1476614552651,"_cnpm_publish_time":1476614552651,"dist-tags":{"latest":"2.0.0"}}