{"id":727,"url":"https://github.com/sindresorhus/noop-stream","last_synced_at":"2025-08-23T00:03:07.543Z","repository":{"id":55002605,"uuid":"188680676","full_name":"sindresorhus/noop-stream","owner":"sindresorhus","description":"Create a readable Node.js stream that produces no data (or optionally blank data) or a writable stream that discards data","archived":false,"fork":false,"pushed_at":"2023-05-27T14:59:43.000Z","size":9,"stargazers_count":52,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-28T13:21:43.717Z","etag":null,"topics":["dev-null","nodejs","nodejs-stream","noop","npm-package","readable-stream","stream"],"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/sindresorhus.png","metadata":{"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"},"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,"governance":null}},"created_at":"2019-05-26T12:34:41.000Z","updated_at":"2025-01-07T20:11:38.000Z","dependencies_parsed_at":"2023-09-24T06:14:30.932Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/noop-stream","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"1ae9ff0dce4a895064ed31f90787f53d5faf1330"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnoop-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnoop-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnoop-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fnoop-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/noop-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237209693,"owners_count":19272496,"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":["dev-null","nodejs","nodejs-stream","noop","npm-package","readable-stream","stream"],"created_at":"2024-01-05T20:15:29.862Z","updated_at":"2025-02-04T22:31:27.359Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Libraries"],"sub_categories":["Streams"],"readme":"# noop-stream\n\n\u003e Create a readable Node.js stream that produces no data (or optionally blank data) or a writable stream that discards data\n\nThis can be useful for testing, fixtures, draining a stream, etc. [(Example)](https://github.com/sindresorhus/file-type/commit/7d14761b757912bccc464fc3fb86398f2a533999)\n\nIt's like `fs.createReadStream('/dev/null')` but cross-platform.\n\n## Install\n\n```sh\nnpm install noop-stream\n```\n\n## Usage\n\n```js\nimport stream from 'node:stream';\nimport {readableNoopStream} from 'noop-stream';\n\nstream.pipeline(readableNoopStream({size: 10}), process.stdout);\n```\n\n```js\nimport stream from 'node:stream';\nimport {writableNoopStream} from 'noop-stream';\n\nstream.pipeline(process.stdin, writableNoopStream());\n```\n\n## API\n\n### readableNoopStream(options?)\n\nCreate a readable Node.js stream that produces no data (or optionally blank data).\n\nOptions are passed to the [`stream.Readable` constructor](https://nodejs.org/api/stream.html#stream_new_stream_readable_options), except for the `read` option.\n\nYou can also specify a `size` option, which is the size in bytes to produce. By default, it's `0`. Set it to `Infinity` to make it produce data until you manually destroy the stream.\n\n### writableNoopStream(options?)\n\nCreate a writable Node.js stream that discards received data.\n\nOptions are passed to the [`stream.Writable` constructor](https://nodejs.org/api/stream.html#stream_constructor_new_stream_writable_options), except for the `write` option.\n\n## Related\n\n- [dev-null-cli](https://github.com/sindresorhus/dev-null-cli) - Cross-platform `/dev/null`\n- [random-bytes-readable-stream](https://github.com/sindresorhus/random-bytes-readable-stream) - Creates a readable stream producing cryptographically strong pseudo-random data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fnoop-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fnoop-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fnoop-stream/lists"}