{"name":"flush-write-stream","version":"1.1.1","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":"^2.3.6"},"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":"bab61bb3805d5750cb864aeee387fbddea93c913","_id":"flush-write-stream@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==","shasum":"8dd7d873a1babc207d94ead0c2e0e44276ebf2e8","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.1.1.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\nwsFcBAEBCAAQBQJcXWhRCRA9TVsSAnZWagAAO6AP/1PeJON8gEoXFRpQyMvK\nev0cTYLHqU0z52V9dvugJ+RVvrdXfLXf63lSAiOjc3KBONbdhKFavJU+QlrA\nbqIx7pq5X61gvsFzgWfkGVluOCb0sgr2aJ4BcyeYrETrPCUV2QibPz0tqoyu\ntUvTeeIR3wGrksA5HUIHdf3f35E5ZTBMK18sTaA2PkTgj6VuQ4m8NBxgkatL\n1LVNh+n3kQvzH2nBtwsPZKzDFSXHvTpPNgjwIuasewe96f9rJAsPBgA32c1j\nVUs5QVKQyl3fGFCpA5W9fQBS40j89I1yAetgT+6zXMfRz2z9Gvx0C5UTyD3h\njX7vu/ktZb2kmlWPbHcNwRFCSsm53cpZ2LFj0u5Pw9EcC9aBiK2dGdQJeOaS\nd2Vn7IXMUKip7yOZcnMv3N4YGx6+mjHIOweIJKfu1z/S4kjGmZ2nLQKrO2Vz\nzOZCJoRjMpZUbv+ATZ2t2WfKe3YcXLmfJHs3p0fRSe1HjBvkrjHbRE7L0ML+\nksZr0m2fi0bYu3uY08VkJN9pR1c+4iuU5zc1gCUH5EgnkEH0MHfXrcbXskwy\ndk9Qpc2BkWD+wcIHjw/xApktFqPsCTM7SrR+XEHElgyUOyeW7H4gQ741iOHf\nhFmMUl0zin/p2Jstylv+zDI8e2JKfFQ3WsgMSq7Qi1XJ8Ta4Q2xtwbhBpkd+\nQLEn\r\n=Qfkq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDuPGWIhw0d+xYIn+zd/1voyJKfd8sIAk1k1p6c/+JMmAiBbQl0aZYA+nWyXwqKg579EfIl6Bae5RPJMgsQqV5XPBQ=="}],"size":2534,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.1.1.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.1.1_1549625425108_0.2525437003881257"},"_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":1549625425188,"_cnpm_publish_time":1549625425188,"dist-tags":{"latest":"2.0.0"}}