{"id":19494742,"url":"https://github.com/ceejbot/patient-stream","last_synced_at":"2025-04-25T21:32:08.183Z","repository":{"id":17685604,"uuid":"20491501","full_name":"ceejbot/patient-stream","owner":"ceejbot","description":"a stream that can be piped to many destinations","archived":false,"fork":false,"pushed_at":"2014-08-01T01:41:05.000Z","size":174,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-11T11:05:33.783Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceejbot.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":"2014-06-04T16:40:13.000Z","updated_at":"2019-07-11T16:03:14.000Z","dependencies_parsed_at":"2022-09-11T15:11:21.878Z","dependency_job_id":null,"html_url":"https://github.com/ceejbot/patient-stream","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fpatient-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fpatient-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fpatient-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fpatient-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceejbot","download_url":"https://codeload.github.com/ceejbot/patient-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224018540,"owners_count":17242080,"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-10T21:32:47.685Z","updated_at":"2024-11-10T21:33:10.060Z","avatar_url":"https://github.com/ceejbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# patient-stream\n\nA stream that can be piped to many destinations over several ticks, so long as you know in advance how many destinations you'll need. Why? Because sometimes it's a drag to wrap everything in Passthrough streams in the same tick.\n\n[![Build Status](http://img.shields.io/travis/ceejbot/patient-stream.svg?style=flat)](http://travis-ci.org/ceejbot/patient-stream)\n![Coverage](http://img.shields.io/badge/coverage-100%25-green.svg?style=flat)\n\n## Usage\n\nPause your input stream (important). Construct a `Patient` with the number of destinations you expect to add. At your leisure, bearing in mind that you've now got backpressure on your input, add all your destinations. When you've added as many as your `Patient` expects, the input will be resumed for you. The `Patient` will emit `end` when all its destinations have emitted `finish`.\n\n```javascript\nvar fs = require('fs'),\n    Request = require('request'),\n    Patient = require('patient-stream');\n\nvar input = Request.get('http://placekitten.com/400/400');\ninput.pause(); // required\nvar out1 = new fs.createWriteStream('kitten_copy1.jpg');\nvar out2 = new fs.createWriteStream('kitten_copy2.jpg');\n\ntee.on('end', function()\n{\n    // do something with the two lovely kitten jpgs\n});\n\nvar tee = new Patient(2);\ninput.pipe(tee);\ntee.pipe(out1);\n\nsetTimeout(function()\n{\n    tee.pipe(out2);\n}, 1000);\n```\n\n## API\n\n`PatientStream` is a passthrough stream, so it has the same API as a duplex stream.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fpatient-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceejbot%2Fpatient-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fpatient-stream/lists"}