{"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":{"integrity":"sha512-6MHED/cmsyux1G4/Cek2Z776y9t7WCNd3h2h/HW91vFeU7pzMhA8XvAlDhHcanG5IWuIh/xcC7JASY4WQpG6xg==","shasum":"2e89a8bd5eee42f8ec97e43aae81e3d5099c2ddc","tarball":"http://registry-npm.ywwl.com/flush-write-stream/download/flush-write-stream-1.1.0.tgz","fileCount":7,"unpackedSize":6512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWANoCRA9TVsSAnZWagAAyzwP/0R/kZ0ApTRQZswgVKZv\nBS1qKpEz4jfTDV/OELjYh88cTPKvAFApDJ9mR6eyH5W/t6MsAe8d/j9miTxz\nWj8/5e37KEKy3qZTz1uUk7Mf9oYROG0qpNpehH/xGNxS1cOzg09uyD3j3QUU\ngNAtVyMGnMFYlq7ibJlhKZOiYu+8enRPOfj2BGXYGkDt+ujvBzOFUUpeSY03\n2wbiJkwVkCsWGPpkUd5MDYjovPK4Q5Mip6TzIfAaQiH0GZUrMgNh3wyCuTob\niC3q7l0MxmZqjovWwqMOXNnTiCE4i+RDVbM7jPd89Gec4rs/95T9n284iCw+\nGVv9MExeVOoMkzZ9fesqrA8ezWcJ/sj6OwH05N1Uz0fmUsXVtxmQjval6eUe\ncaijTikLRabA463njYi7CX/VROOqZzrV4USU/Rl2IBzwJFfAnkSuI0Xa8hWy\nv/xKCVvJb2uZPG0/24WJqfE0Qy+9i0JLq+/8dSm+QFJxpi06i89nmWywmxox\nAbY2N579+Be2eYt32hkBNT/BVvPWtv5EiZtplXV0WeFZECqG1J6qi58GW8j8\ncJ0/0Pkg3SPqqMdD3kLWNsUOKE7AlAbJ2ujC7Prml2WN7l17gsER2oZvhpBo\nYVanzxl0mzA+yosqUbBe1ZXgLlAOsVsCcDZlaY7I4Ow0eoUFlCHLTkp729Xv\n9XBg\r\n=kCSG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeLSYNb6g7UsDRp9UbgSEjd4+gON8wBSyY2MS5kql78wIhAMwB2uxPNrvRLPcPrjYQgIw9li9Z5gT2CHC6VOjVzPA/"}],"size":2543,"noattachment":false,"key":"/flush-write-stream/-/flush-write-stream-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flush-write-stream_1.1.0_1549271911926_0.4645147990967873"},"_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":1549271912074,"_cnpm_publish_time":1549271912074,"dist-tags":{"latest":"2.0.0"}}