{"id":16240083,"url":"https://github.com/kylepdavis/node-stream-utils","last_synced_at":"2025-07-09T23:09:56.097Z","repository":{"id":5158516,"uuid":"6326979","full_name":"KylePDavis/node-stream-utils","owner":"KylePDavis","description":"Stream utilities with support for stream resets.","archived":false,"fork":false,"pushed_at":"2012-11-19T12:59:43.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T11:46:22.669Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KylePDavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-21T23:40:36.000Z","updated_at":"2013-10-25T11:38:39.000Z","dependencies_parsed_at":"2022-09-26T16:21:46.278Z","dependency_job_id":null,"html_url":"https://github.com/KylePDavis/node-stream-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KylePDavis/node-stream-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KylePDavis%2Fnode-stream-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KylePDavis%2Fnode-stream-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KylePDavis%2Fnode-stream-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KylePDavis%2Fnode-stream-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KylePDavis","download_url":"https://codeload.github.com/KylePDavis/node-stream-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KylePDavis%2Fnode-stream-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505016,"owners_count":23618877,"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-10-10T13:46:11.417Z","updated_at":"2025-07-09T23:09:56.080Z","avatar_url":"https://github.com/KylePDavis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"stream-utils\n============\nStream utilities with support for stream resets.\n\n\nexports\n-------\n * ThroughStream([write], [end], [reset]) - creates a new \"through\" Streams which readable and writable that acts based on the given write, end, and reset handler functions.\n * DuplexStream(writable, readable) - combines a writable stream and a readable stream into a duplexed Stream.\n * Pipeline(stream1, stream2, ...) - creates a new Stream that sends data to all of the given Streams.\n\n\nExamples\n--------\nHere's a simple and somewhat contrived example of how you might use the through stream helper to apply a math operation.\n\n``` js\nvar su = require(\"stream-utils\"),\n\tthrough = su.ThroughStream;\n\nvar inputs = [1, 2, 3],\n  outputs = [],\n  doubler = through(function(val){  // on data queue doubled value\n    this.queue(val * 2);\n  })\n    .on(\"data\", function(val2){  // on data push into outputs\n      outputs.push(val2);\n    });\n\ninputs.forEach(doubler.write);\n\n// --\u003e outputs is: [2, 4, 6]\n```\n\n\nWhy?\n----\nI needed a set of Stream utilities that would make it easier to build and reuse chains of complex Object stream mutators.\nOriginally I used the `event-stream` package but I ran into a few issues with my use cases that drove me to roll my own solution based on what I had learned from that code.\n\n\nLicense\n-------\nMIT / Apache2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylepdavis%2Fnode-stream-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylepdavis%2Fnode-stream-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylepdavis%2Fnode-stream-utils/lists"}