{"id":14982042,"url":"https://github.com/gulpjs/ordered-read-streams","last_synced_at":"2025-04-07T11:09:12.440Z","repository":{"id":13223004,"uuid":"15907313","full_name":"gulpjs/ordered-read-streams","owner":"gulpjs","description":"Combines array of streams into one Readable stream in strict order.","archived":false,"fork":false,"pushed_at":"2023-04-15T22:14:56.000Z","size":42,"stargazers_count":28,"open_issues_count":0,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-29T15:14:37.160Z","etag":null,"topics":["javascript","readable-stream","stream","streamx"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gulpjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["gulpjs","phated","yocontra"],"tidelift":"npm/gulp","open_collective":"gulpjs"}},"created_at":"2014-01-14T16:07:47.000Z","updated_at":"2023-11-05T01:05:36.000Z","dependencies_parsed_at":"2022-08-24T08:40:51.368Z","dependency_job_id":"bee0077a-bef5-49c5-aa22-d135a53cf0e5","html_url":"https://github.com/gulpjs/ordered-read-streams","commit_stats":{"total_commits":57,"total_committers":11,"mean_commits":5.181818181818182,"dds":0.5789473684210527,"last_synced_commit":"e0a21d9858cc86e406d9cea7d6900bd13111b4f9"},"previous_names":["armed/ordered-read-streams"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fordered-read-streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fordered-read-streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fordered-read-streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fordered-read-streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gulpjs","download_url":"https://codeload.github.com/gulpjs/ordered-read-streams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247362726,"owners_count":20926828,"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":["javascript","readable-stream","stream","streamx"],"created_at":"2024-09-24T14:04:41.311Z","updated_at":"2025-04-07T11:09:12.410Z","avatar_url":"https://github.com/gulpjs.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gulpjs.com\"\u003e\n    \u003cimg height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# ordered-read-streams\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nCombines array of streams into one Readable stream in strict order.\n\n## Usage\n\n```js\nvar { Readable } = require('streamx');\nvar ordered = require('ordered-read-streams');\n\nvar s1 = new Readable({\n  read: function (cb) {\n    var self = this;\n    if (self.called) {\n      self.push(null);\n      return cb(null);\n    }\n    setTimeout(function () {\n      self.called = true;\n      self.push('stream 1');\n      cb(null);\n    }, 200);\n  },\n});\nvar s2 = new Readable({\n  read: function (cb) {\n    var self = this;\n    if (self.called) {\n      self.push(null);\n      return cb(null);\n    }\n    setTimeout(function () {\n      self.called = true;\n      self.push('stream 2');\n      cb(null);\n    }, 30);\n  },\n});\nvar s3 = new Readable({\n  read: function (cb) {\n    var self = this;\n    if (self.called) {\n      self.push(null);\n      return cb(null);\n    }\n    setTimeout(function () {\n      self.called = true;\n      self.push('stream 3');\n      cb(null);\n    }, 100);\n  },\n});\n\nvar readable = ordered([s1, s2, s3]);\nreadable.on('data', function (data) {\n  console.log(data);\n  // Logs:\n  // stream 1\n  // stream 2\n  // stream 3\n});\n```\n\n## API\n\n### `ordered(streams, [options])`\n\nTakes an array of `Readable` streams and produces a single `OrderedReadable` stream that will consume the provided streams in strict order. The produced `Readable` stream respects backpressure on itself and any provided streams.\n\n#### `orderedReadable.addSource(stream)`\n\nThe returned `Readable` stream has an `addSource` instance function that takes appends a `Readable` stream to the list of source streams that the `OrderedReadable` is reading from.\n\n## License\n\nMIT\n\n\u003c!-- prettier-ignore-start --\u003e\n[downloads-image]: https://img.shields.io/npm/dm/ordered-read-streams.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/ordered-read-streams\n[npm-image]: https://img.shields.io/npm/v/ordered-read-streams.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/ordered-read-streams/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/ordered-read-streams/dev.yml?branch=master\u0026style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/ordered-read-streams\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/ordered-read-streams/master.svg?style=flat-square\n\u003c!-- prettier-ignore-end --\u003e\n","funding_links":["https://github.com/sponsors/gulpjs","https://github.com/sponsors/phated","https://github.com/sponsors/yocontra","https://tidelift.com/funding/github/npm/gulp","https://opencollective.com/gulpjs"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Fordered-read-streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgulpjs%2Fordered-read-streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Fordered-read-streams/lists"}