{"_id":"accumulate-stream","_rev":"1049287","name":"accumulate-stream","description":"Transform stream that accumulates and emits data upon events","dist-tags":{"latest":"5.0.0","next":"5.0.0-next.3"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"time":{"modified":"2024-09-18T08:09:59.000Z","created":"2021-01-27T02:30:34.376Z","5.0.0":"2021-11-07T19:36:05.320Z","5.0.0-next.3":"2021-01-27T02:30:34.376Z"},"users":{},"author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"repository":{"type":"git","url":"git+https://github.com/rannn505/child-shell.git","directory":"packages/accumulate-stream"},"versions":{"5.0.0":{"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,"publish_time":1636313765320,"_cnpm_publish_time":1636313765320},"5.0.0-next.3":{"name":"accumulate-stream","version":"5.0.0-next.3","description":"Useful implementations for writable stream","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.2"},"devDependencies":{"@types/bytes":"^3.1.0","@types/ms":"^0.7.31","@types/node":"^13.13.4"},"gitHead":"7badde5984299f245b6a0a188474a14604a83d44","_id":"accumulate-stream@5.0.0-next.3","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (darwin)","dist":{"integrity":"sha512-IzuViNydqr06QZm1drQqdOXJKR/Aec7uYSgefhhcYn5cwja20qvmHqHLx9RDOzY8elNsXXkbXhknOs6AFOThGw==","shasum":"d2c40c774f463e177e0f987bb0e674fe39016d01","tarball":"http://registry-npm.ywwl.com/accumulate-stream/download/accumulate-stream-5.0.0-next.3.tgz","fileCount":9,"unpackedSize":11445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgENBKCRA9TVsSAnZWagAAouYP/jQpFsWtv8KoGi8GT9pp\n7gmODmGnK3QRiceEx7FJRx+B+DQeoxhj8A2g55DwM2iw35blPfN0Kz5RPMJz\nMWxkFPIsVmamunS6A+rwuBQxfb0yb2XBAFOJgnPzRXK9+q9CjIVZZsu+R6AE\noqcmRN9xOfS9dCcTAnYBpEBAqWv9WHq7koYHK6bf9oNDvMvPXtbcu7X0179C\n48zwTYSomzGNUd0gHg9Pf1IPS71yAxIguwPfiDuMGYd5m8GOwSnGdNjuF8VT\nGdCn8ih8Rkjz9s9k+aia4rS4GxzbX64+4s5Kgl/LZbFncmGwBevNoe81B7S/\naNOUjLYQlaQs4oEsJs1S0K9B8+Jb40ROhma5+7nsAn59wmHkEAARmy2SUUH/\nJcwZE5ZSA2eCOgruPWYqv1CECNyt1YRzAWz2Xf21plL1xmjl45b4DAsxIGwm\na/4QODdtV6/MU6HiFNP6SbrXYtBEi7zYhBI/JU6BAhV2C06A15ecFnWh1qYC\nNpdNcCaS7aWPgh07s7S1bvuctlDYxN9UcJQd12Vur76r3BJ8EWqcy2d54s3e\nLXfO7gtph5aV5jjSSYxJ0AVQJKP7T8y6s9kpO9Q74TTCRjuA27SiTS4r7FOU\ni2nJseC+HJBSruwtequEq3hJ4pIPZ1lMpG4EdUaxYQloSUVEptnxhPzXAkdk\ngCh+\r\n=OnzD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAN4y96boNeznkOu/+KvKRjYTUq8qTu+/AwtEMzHahYpAiEA0TkgV3WkfYUFpLPN3E9WqdiO/Ajct8e00WQlCZb4/qk="}],"size":4156,"noattachment":false,"key":"/accumulate-stream/-/accumulate-stream-5.0.0-next.3.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-next.3_1611714634152_0.03791794436004303"},"_hasShrinkwrap":false,"publish_time":1611714634376,"_cnpm_publish_time":1611714634376}},"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","_attachments":{},"homepage":"https://github.com/rannn505/child-shell/tree/master/packages/accumulate-stream#readme","bugs":{"url":"https://github.com/rannn505/child-shell/issues"},"license":"MIT"}