{"name":"minipass-flush","version":"1.0.7","publishConfig":{"tag":"v1-legacy"},"description":"A Minipass stream that calls a flush function before emitting 'end'","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"BlueOak-1.0.0","scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^15.1.6"},"dependencies":{"minipass":"^3.0.0"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/isaacs/minipass-flush.git"},"keywords":["minipass","flush","stream"],"engines":{"node":">= 8"},"readmeFilename":"README.md","gitHead":"82ef1410575a50835e7dae4e8c9e9a0f214eeaa1","_id":"minipass-flush@1.0.7","bugs":{"url":"https://github.com/isaacs/minipass-flush/issues"},"homepage":"https://github.com/isaacs/minipass-flush#readme","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-TbqTz9cUwWyHS2Dy89P3ocAGUGxKjjLuR9z8w4WUTGAVgEj17/4nhgo2Du56i0Fm3Pm30g4iA8Lcqctc76jCzA==","shasum":"145c383d5ae294b36030aa80d4e872d08bebcb73","tarball":"http://registry-npm.ywwl.com/minipass-flush/download/minipass-flush-1.0.7.tgz","fileCount":4,"unpackedSize":4618,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDd3nrwSqUEl/UwUYjgP6p+PfdWmESLfnP0Lps9F54DswIhAN9pSHfW1LohcB6CRiBZ36LUjlcUCjhDcoLN6r2Z0Sk1"}],"size":2191,"noattachment":false,"key":"/minipass-flush/-/minipass-flush-1.0.7.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/minipass-flush_1.0.7_1774540791173_0.7205683408064274"},"_hasShrinkwrap":false,"readme":"# minipass-flush\n\nA Minipass stream that calls a flush function before emitting\n'end'.\n\n## USAGE\n\n```ts\nimport { Flush } from 'minipass-flush'\nconst f = new Flush<Buffer>({\n  flush(cb) {\n    // call the cb when done, or return a promise\n    // the 'end' event will wait for it, along with\n    // close, finish, and prefinish.\n    // call the cb with an error, or return a rejecting\n    // promise to emit 'error' instead of doing the 'end'\n    return rerouteAllEncryptions().then(() => clearAllChannels())\n  },\n  // all other minipass options accepted as well\n})\n\nsomeDataSource.pipe(f).on('end', () => {\n  // proper flushing has been accomplished\n})\n\n// Or as a subclass implementing a 'flush' method:\nclass MyFlush extends Flush {\n  flush(cb) {\n    // old fashioned callback style!\n    rerouteAllEncryptions(er => {\n      if (er) return cb(er)\n      clearAllChannels(er => {\n        if (er) cb(er)\n        cb()\n      })\n    })\n  }\n}\n```\n\nThat's about it.\n\nIf your `flush` method doesn't have to do anything asynchronous,\nthen it's better to call the callback right away in this tick,\nrather than returning `Promise.resolve()`, so that the `end`\nevent can happen as soon as possible.\n","publish_time":1774540791301,"_cnpm_publish_time":1774540791301,"dist-tags":{"latest":"2.0.1","v1-legacy":"1.0.7"}}