{"_id":"@art-of-coding/use-stream","_rev":"2-e530942ba9d43cee7aa11dfe63e59f8e","name":"@art-of-coding/use-stream","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@art-of-coding/use-stream","version":"0.0.1","description":"Use Redis Streams","main":"./dist/index.js","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"homepage":"http://github.com/Art-of-Coding/use-stream","repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/use-stream.git"},"engines":{"node":">=15"},"license":"MIT","dependencies":{"ioredis":"^4.27.3","redis-streams-manager":"^2.1.0"},"devDependencies":{"@types/ioredis":"^4.26.4","@types/node":"^15.6.1"},"bugs":{"url":"https://github.com/Art-of-Coding/use-stream/issues"},"_id":"@art-of-coding/use-stream@0.0.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-ySoV5Gqq/m9hQ+rWTuqtbdk1voSPJ3wwjiJGx0eu5xWiLA+6tLq6cFlzbaq7DzdZHw64QQqZLUDBUwObUL2i3Q==","shasum":"66b1e7ae9cf32af7ad90a7972cfc1e5b179303c2","tarball":"https://registry.npmjs.org/@art-of-coding/use-stream/-/use-stream-0.0.1.tgz","fileCount":5,"unpackedSize":3329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsnZ6CRA9TVsSAnZWagAAcvkP/Rdw83nnWi1WdszSkAtW\n5vJkTPttnxd2vFS9kzYVHYooNMVG2/oOvgi8/UOVNgotrCJmW0wGJZRMcFDF\n4TVwtN0Q6YgChhR5UJjm0+Rr3ZwuLTlPugS0junhV8DtgKgzrSX21XEJB4Ru\nXRTv8FOIE8Ly5KDrgagbOekfnM6fea+daTKSdnRGkmGOo7U2PYsytx8435Mb\n/X9rNOI2UNHlHMgfeoeahEJiCdojRtOqtiuPL+staDt3u+Cns07Vm4h0y5ZC\n7fuAwpkK9bHJEyhnCtplEahHmHodBcx2bNGFFZBkfenMnVrApRn+8TgoOiOx\n9ot5zIARsurA5VL4oFZWe/y4m5QZlP6ik1031kF6YeIrEccGMz6PqPpB9mGU\nCGWfHZ10QjNxfOZHIIDMsvqc8mjAOzSCF2tM68r1rtb6eZ8Lc2NaJGZBsyx0\nj/3/LfIoGqnDJ3wzC+ozT4G6820MkRdMy/rvfYFk5csFzqwUA6jGc/UwalbS\n0Ama7+aBbLoCv2GC6VWRx+CxQHh5VheXrE0/8m8U2+RS6nfCqckoH78VHHNE\n8xlnGI7pHn3eAN4hc2O5KXzf9nYKNJw5glDiU4Lqbd+C6gKhf4iX8+NFzwVx\n6YxLiqN6Fxwv9XcCbPCCsYKvyYEAR8Mx6SARXueE2kpNByO5SdNdFS7Q+UV0\nOe1n\r\n=yU4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXNJhxVunS5Ap50KbhEeygHs1WYZOmUOnOpI98Fd+FygIhAJ/q9jxZW+LfiNLDn3eDjHhchiEwOND81EGS9xD3Vxxh"}]},"_npmUser":{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"},"directories":{},"maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-stream_0.0.1_1622308474040_0.701821703077145"},"_hasShrinkwrap":false},"0.0.2":{"name":"@art-of-coding/use-stream","version":"0.0.2","description":"Use Redis Streams","main":"./dist/index.js","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"homepage":"http://github.com/Art-of-Coding/use-stream","repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/use-stream.git"},"engines":{"node":">=15"},"license":"MIT","devDependencies":{"@types/ioredis":"^4.28.7","@types/node":"^17.0.8"},"dependencies":{"redis-streams-manager":"^2.2.0"},"types":"./dist\\index.d.ts","gitHead":"a5af78523153eb5a9da7b95ee95598d22b8f772d","bugs":{"url":"https://github.com/Art-of-Coding/use-stream/issues"},"_id":"@art-of-coding/use-stream@0.0.2","_nodeVersion":"17.1.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-ZX83iFlYPnlU8gRaRgFk+qNTXvo9Myw+UK4Xbhgns1JBHQvmWzNNJELk7r9AQ4iqh1qrF195mQROZxE5M5NgzA==","shasum":"2cf023999f5981bdbab791dfa58f670f9d95ce19","tarball":"https://registry.npmjs.org/@art-of-coding/use-stream/-/use-stream-0.0.2.tgz","fileCount":5,"unpackedSize":3666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3ZmWCRA9TVsSAnZWagAAM0cQAJrex/Q5VuvjsS/CEr9B\nwyZFzU4SQ397di6bXxPTCKjhPUcM1ljU1lPROfl0h/rIp0jaPGmpvPv4y/sF\njnwGceggAApoTm21S5ILl2cr+lSrCE0O9lLbyWrNCzfGagqfTDGecr4Akoi/\npSrpBXLrNWpK34cZ4hC4938eRdcxINjvwsFOnpE1352JCj5vLcZadyn0Ka1v\nr9Igsp60eZUvjfGTdpn45aUdkMKKfPog8/Gu4M9r8C5X2aykvapDWAW9z2Xd\nwFXuRt3oO6qUO/geQhyoURBDTEmHP9Axv2MdL2bOaSvl7hB+DUi4hm3fFTal\nERc8pyZUzK0lbOfF27K12vEWpIbkS9J42lhIJR+YPxWcslrUnP5u6A+nUrPG\n/v6/D1a3m1gOR9VE3fktZebystzrpVPhLAWphmwi8c0QWYgfSnM/7m6zlnwy\nUesfjIMb0OO66/66Z0BB3mXZR23r86Hql7ceu0f+9PN2iUnSwRhsH4+oyKah\nMqaOAkp8U8npUBu2f4K+6EGALpvhlJfXg7KB9NgNOItJoMSJc5MSYSC6mF7f\nnivXLsXH1xBU9oAglC3BorlNrM7sesBjtbaLOsrGmSwUty15UCVfki6426nq\nTY3VDx4lXzVrcZPZdK+CLdfHAFMJV9LVRS7RXqOKh5geFJEqccWCeOr0ByL9\nM5rN\r\n=0dfl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbfuYFQBvkcFtkKALZIr27Fl0+f7TOg0SEymayhK7oWgIgNfLhlLlnnArQ9MUI63gEXuVyWGfuciktxCWuzshTHDo="}]},"_npmUser":{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"},"directories":{},"maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-stream_0.0.2_1641912726418_0.6715582644229305"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-29T17:14:33.845Z","0.0.1":"2021-05-29T17:14:34.167Z","modified":"2022-04-04T15:35:55.608Z","0.0.2":"2022-01-11T14:52:06.571Z"},"maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"description":"Use Redis Streams","homepage":"http://github.com/Art-of-Coding/use-stream","repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/use-stream.git"},"author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"bugs":{"url":"https://github.com/Art-of-Coding/use-stream/issues"},"license":"MIT","readme":"# Use Redis Streams\r\n\r\n'Use' Redis streams for node.js.\r\n\r\nInspired by `React` Hooks.\r\n\r\nExtracted from a personal project. It makes use of my other streams library,\r\n[redis-streams-manager](https://github.com/MichielvdVelde/redis-streams-manager).\r\n\r\n## Install\r\n\r\n```\r\nnpm i @art-of-coding/use-stream\r\n```\r\n\r\n## Example\r\n\r\nEvery call to `useStream` creates a separate subscription,\r\nso you can use `unsubscribe()` when you're done locally\r\nwithout affecting other possible subscriptions.\r\n\r\n```typescript\r\nimport IORedis from 'ioredis'\r\nimport buildUse from '@art-of-coding/use-stream'\r\nimport StreamsManager from 'redis-streams-manager'\r\n\r\nconst blockingConnection = new IORedis()\r\nconst manager = new StreamsManager(blockingConnection)\r\n// Build a use function\r\nexport const useStream = buildUse(manager)\r\n\r\n// somewhere else...\r\n\r\nconst [events, unsubscribe] = useStream('my-stream')\r\n\r\nevents.on('entry', (entry: Record<string, string>, id: string) => {\r\n  // do something with the entry\r\n  // and unsubscribe from the stream\r\n  unsubscribe()\r\n})\r\n```\r\n\r\n## License\r\n\r\nCopyright 2021 [Michiel van der Velde](https://michielvdvelde.nl).\r\n\r\nThis software is licensed under [the MIT License](LICENSE).\r\n","readmeFilename":"README.md"}