{"name":"accumulate-stream","version":"5.0.0","description":"Transform stream that accumulates and emits data upon events","author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"homepage":"https://github.com/rannn505/child-shell/tree/master/packages/accumulate-stream#readme","license":"MIT","main":"dist","types":"dist","directories":{"doc":"doc","lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/rannn505/child-shell.git","directory":"packages/accumulate-stream"},"bugs":{"url":"https://github.com/rannn505/child-shell/issues"},"publishConfig":{"access":"public"},"scripts":{},"dependencies":{"bytes":"^3.1.0","ms":"^2.1.3"},"devDependencies":{"@types/bytes":"^3.1.1","@types/ms":"^0.7.31","@types/node":"^16.11.6"},"gitHead":"53d55fe71982aad3d10dfa2b962554675283f9c9","_id":"accumulate-stream@5.0.0","_nodeVersion":"14.18.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-a1pAtAy+LFCAQ6EpAwDeHERf99nadIXa8UApaddabeF18IsL8cD67WL67E/cRJf4EkZyR9z4F+9g+OCl3Cqi4w==","shasum":"75b19c5f18f02a0a7eac2c58580919af7e5aa902","tarball":"http://registry-npm.ywwl.com/accumulate-stream/download/accumulate-stream-5.0.0.tgz","fileCount":8,"unpackedSize":10857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2i6ZCRA9TVsSAnZWagAACQsP/j8nxEq6Q1ZOQ/QJnQQ4\npJ1lBgAXQaqA8hUvOY0WOFQmIxFzYD/beCsuHn3acoTGvrJY+FVDpELsAcz8\n2+grsyr3IGsVznFqFcjCFwBYM4kYGwpRj4U6j2RebnxV6kV14ihyDKSCm/5S\nhwci7J3O5TN8urwTtnE8gP/iz8mTyoTDfV4Yw6qWuDk8p3b6fin9R7F2dc0e\nrEJ00zOo9yjWKAOuGJigolSBwbIt8Rkjwqec4dVlUc2S0NFWk8l2QFYNiizo\navQbgyXO0sBDdHEBSWfz0zkcIcymlxZCeJMIQt9cOPUEHAcauoAx+rFcVK52\nreCRRxt/O2fLA5ZGY6/OiXifnKrNb776mqVjkh986a325sQXyF9KZHst8h13\n7KiWc991aHsgBs+aDMb6lr6hMjfpvgI+Faz32SODCFDLZXTYM41sIECQnKAB\n7cSt0aWSU5H4nrRh6cTWGay6sVynbrK2lm1JGog62RNE8XOpnJUw3Pf6BXi1\nGxCWpCyE7um18/rvP4WBsHVmluBAL2ppiI51SSoJXx4SCwUtMVPvrDBhMPH2\n+iq9FeulHDXExEhILk3PlVTAWdew04plxMeRCQGMmv0GewkM3MSnFbejKC+0\ne3SydRrBMVlPZB0HLNhw/pbUU+qqoFI2bHMQH3+CF3WOcFGz1KP90dPrcBNO\nA9QC\r\n=f/Lg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3QgkmaEcCeU6qvzHlIMILridO6VwZntXensQPr/C6ZgIhAMj8ddEE5hdVVJNuQoBzCeoYympS/k1cVdpIDkQKE1EY"}],"size":3500,"noattachment":false,"key":"/accumulate-stream/-/accumulate-stream-5.0.0.tgz"},"_npmUser":{"name":"rannn505","email":"rannn505@outlook.com"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accumulate-stream_5.0.0_1636313765107_0.3951693898956039"},"_hasShrinkwrap":false,"readme":"# `accumulate-stream`\n\n> Transform stream that accumulates and emits data upon events\n\n## Installation\n\n```bash\n$ npm i -S accumulate-stream\n$ yarn add accumulate-stream\n```\n\n## Usage\n\n```js\nimport { createReadStream } from 'fs';\nimport { once } from 'events';\nimport { AccumulateStream } from 'accumulate-stream';\n\n(async (): void => {\n  // file.txt: (2kb)\n  // streams are awesome.\n  // streams are awesome.\n  // ... ...\n  const readable = createReadStream('file.txt');\n  const accumulator = new AccumulateStream({ size: '1kb', phrase: 'awesome' });\n  readable.pipe(accumulateStream);\n\n  // will be emitted every 1kb and 2 writes\n  accumulator.on('chunk', ({ buffer }) => console.log(`emitted every chunk write - ${buffer.toString()}`));\n  accumulator.on('size', ({ buffer }) => console.log(`emitted every 1kb of chunks - ${buffer.toString()}`));\n  accumulator.on('phrase', ({ buffer }) =>\n    console.log(`emitted whenever \"stream\" phrase is detected in chunk - ${buffer.toString()}`),\n  );\n  accumulator.on('data', ({ buffer }) => console.log(`emitted whenever one of the conditions is met - ${buffer.toString()}`));\n\n  await once(accumulator, 'data');\n  console.log(accumulator.getBuffer().toString()); // streams are awesome.\n})();\n```\n\n## API\n\n// [TBD]\n","publish_time":1636313765320,"_cnpm_publish_time":1636313765320,"dist-tags":{"latest":"5.0.0","next":"5.0.0-next.3"}}