{"name":"flush-write-stream","version":"2.0.0","description":"A write stream constructor that supports a flush function that is called before finish is emitted","main":"index.js","dependencies":{"inherits":"^2.0.3","readable-stream":"^3.1.1"},"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":"cea3fbb3a3d11fb1e226d8893a1749178627b284","_id":"flush-write-stream@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==","shasum":"6f58e776154f5eefacff92a6e5a681c88ac50f7c","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-2.0.0.tgz","fileCount":7,"unpackedSize":6503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXWh3CRA9TVsSAnZWagAAiHIP/3xb/bnCTbJW9iASegn7\n6NoyhqP7JD28hrwOHRrw2xE12wOsMkGTWcydTVhlOjjLjfYuOtyf197n2gm/\nPI41F+T+y5fXIwe9SCdmlrlcS1KKPNFJMVdNxDHsqYmV5fSwcgtG3xuVLCgg\nA5ap0bw5YBzGPOexBT5tpqrlAnXYFrl7bHOpqjdGPa5EPaxTCTlU7QJMfe2J\nh1jqFxXx3eHWb1cBs/8goxC0ISXCnvqPNUl8LU5GzhJ82xtjXzLS6HGRrKXJ\nnp4Xlb6znV27OsxV/SuFzhq8AZTeHJPJmNEMa8VrBgU9bN4U5fAwZJoBOqt3\nTL/SAkP4layhJb7YVYa2pyNFTKjH1S+N3vq7j/kQNZ4F4b5YYsvBF4kgA9xe\nSwW726sNIIgDl4GxmlTrZletQW74YVCwkuK3oSzugpxXBzVybJH/WAaAhzbL\nbSf5owGfPm0QMxJeEn19um5fspdbCk3lWNOp+9BdtimIVEWPJMGxNhy63pdW\nQcNK3w3hpFEvesAlNrP/Yu/vgx7Cx/JLqJID1vbJMM7GHD6DbItlHrl92BHE\nGsSQCg8i5aTyQBAsRTqAjrAk+WkxF/w6jbxuzvoTsTbFFh46KASGABzNht+x\nei2jxhkWeWrl5JOr61/s0Y/EV6He0bBDXl99WpSH0PL1EjNYR+0CHANxnjzp\nnqL3\r\n=e35e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRcbx51RypVRgDT/9H9a6j3VfBzmoeDIwZMhYacmKukAiBNeF4KOUYaAgVLRadSRJ1xv5xLrHOzTug7iH8ho3YglQ=="}],"size":2535,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_2.0.0_1549625462928_0.38196138371240473"},"_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":1549625463031,"_cnpm_publish_time":1549625463031,"dist-tags":{"latest":"2.0.0"}}