{"_id":"flush-write-stream","_rev":"59629","name":"flush-write-stream","description":"A write stream constructor that supports a flush function that is called before finish is emitted","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-06-03T10:19:27.000Z","created":"2015-11-06T21:57:03.152Z","2.0.0":"2019-02-08T11:31:03.031Z","1.1.1":"2019-02-08T11:30:25.188Z","1.1.0":"2019-02-04T09:18:32.074Z","1.0.3":"2018-03-21T11:49:21.221Z","1.0.2":"2016-10-16T10:46:49.463Z","1.0.1":"2016-10-16T10:42:32.651Z","1.0.0":"2015-11-06T21:57:03.152Z"},"users":{"bret":true},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/flush-write-stream.git"},"versions":{"2.0.0":{"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":{"shasum":"6f58e776154f5eefacff92a6e5a681c88ac50f7c","size":2535,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_2.0.0_1549625462928_0.38196138371240473"},"_hasShrinkwrap":false,"publish_time":1549625463031,"_cnpm_publish_time":1549625463031},"1.1.1":{"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":{"shasum":"8dd7d873a1babc207d94ead0c2e0e44276ebf2e8","size":2534,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.1.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.1.1_1549625425108_0.2525437003881257"},"_hasShrinkwrap":false,"publish_time":1549625425188,"_cnpm_publish_time":1549625425188},"1.1.0":{"name":"flush-write-stream","version":"1.1.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":"85d36bb3cde116622da5ac3c966e2cd58d9a75ff","_id":"flush-write-stream@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"2e89a8bd5eee42f8ec97e43aae81e3d5099c2ddc","size":2543,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.1.0_1549271911926_0.4645147990967873"},"_hasShrinkwrap":false,"publish_time":1549271912074,"_cnpm_publish_time":1549271912074},"1.0.3":{"name":"flush-write-stream","version":"1.0.3","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":"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":"3a0c6e62c7c9a5c22abf49cd1a06c960487fa2c9","_id":"flush-write-stream@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c5d586ef38af6097650b49bc41b55fabb19f35bd","size":2552,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.0.3.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.0.3_1521632961113_0.42985920051576776"},"_hasShrinkwrap":false,"publish_time":1521632961221,"_cnpm_publish_time":1521632961221},"1.0.2":{"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","size":2602,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/flush-write-stream-1.0.2.tgz_1476614807882_0.22224654001183808"},"directories":{},"publish_time":1476614809463,"_cnpm_publish_time":1476614809463,"_hasShrinkwrap":false},"1.0.1":{"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","size":2577,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/flush-write-stream-1.0.1.tgz_1476614551011_0.6873086630366743"},"directories":{},"publish_time":1476614552651,"_cnpm_publish_time":1476614552651,"_hasShrinkwrap":false},"1.0.0":{"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","size":2475,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/flush-write-stream/download/flush-write-stream-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"publish_time":1446847023152,"_cnpm_publish_time":1446847023152,"_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","_attachments":{},"homepage":"https://github.com/mafintosh/flush-write-stream","bugs":{"url":"https://github.com/mafintosh/flush-write-stream/issues"},"license":"MIT"}