{"id":20806332,"url":"https://github.com/nodesource/rapid-stream","last_synced_at":"2025-05-11T17:31:45.257Z","repository":{"id":33842016,"uuid":"37544307","full_name":"nodesource/rapid-stream","owner":"nodesource","description":"Through stream that processes elements in parallel, with no regard for input order.","archived":true,"fork":false,"pushed_at":"2015-06-16T17:10:07.000Z","size":100,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T07:45:32.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodesource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-16T17:09:49.000Z","updated_at":"2025-01-30T21:18:05.000Z","dependencies_parsed_at":"2022-08-17T23:55:39.146Z","dependency_job_id":null,"html_url":"https://github.com/nodesource/rapid-stream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Frapid-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Frapid-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Frapid-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Frapid-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodesource","download_url":"https://codeload.github.com/nodesource/rapid-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253604850,"owners_count":21934907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T19:19:21.606Z","updated_at":"2025-05-11T17:31:45.039Z","avatar_url":"https://github.com/nodesource.png","language":"JavaScript","readme":"# rapid-stream\n![](http://img.shields.io/badge/stability-experimental-orange.svg?style=flat)\n![](http://img.shields.io/npm/v/rapid-stream.svg?style=flat)\n![](http://img.shields.io/npm/dm/rapid-stream.svg?style=flat)\n![](http://img.shields.io/npm/l/rapid-stream.svg?style=flat)\n\nThrough stream that processes elements in parallel, with no regard for input order.\n\nSimilar to [parallel-transform](http://github.com/mafintosh/parallel-transform),\nhowever because it ignores input order it can process input faster when incoming\nchunks take a variable amount of time to resolve, e.g. network requests behind\na caching layer.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/rapid-stream.png)](https://nodei.co/npm/rapid-stream/)\n\n### `rapid(parallelism, [opts], handle)`\n\nCreates a new rapid stream that will handle at most `parallelism` chunks at any one\ntime. Optionally, you may pass in `opts` to override the default stream options.\nNote that this is an object mode stream by default.\n\n`handle(chunk, encoding, next)` is called for each incoming chunk, and works more\nor less the same as it does in [through2](http://github.com/rvagg/through2).\n\n``` javascript\nconst RapidStream = require('rapid-stream')\nconst from2       = require('from2')\n\nvar stream = RapidStream(2, function(chunk, encoding, next) {\n  setTimeout(function() {\n    next(null, chunk)\n  }, 1000 * Math.random())\n})\n\nfrom2([1, 2, 3, 4, 5]).pipe(stream).on('data', function(data) {\n  console.log(data)\n})\n\n// 2\n// 1\n// 3\n// 5\n// 4\n```\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/nodesource/rapid-stream/blob/master/LICENSE.md) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Frapid-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesource%2Frapid-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Frapid-stream/lists"}