{"id":13526653,"url":"https://github.com/sindresorhus/is-stream","last_synced_at":"2025-05-15T22:12:08.777Z","repository":{"id":25994462,"uuid":"29436825","full_name":"sindresorhus/is-stream","owner":"sindresorhus","description":"Check if something is a Node.js stream","archived":false,"fork":false,"pushed_at":"2024-10-28T05:10:46.000Z","size":32,"stargazers_count":112,"open_issues_count":0,"forks_count":22,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-13T11:46:51.506Z","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/sindresorhus.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":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-01-18T18:55:15.000Z","updated_at":"2025-05-07T05:19:15.000Z","dependencies_parsed_at":"2024-03-04T04:00:50.693Z","dependency_job_id":"0914be29-9fc4-4f5c-a085-25229cb05bb0","html_url":"https://github.com/sindresorhus/is-stream","commit_stats":{"total_commits":33,"total_committers":6,"mean_commits":5.5,"dds":"0.24242424242424243","last_synced_commit":"ab06c4acc9dce4dcadc9dfc6416e1be2c836862d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/is-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254266521,"owners_count":22042123,"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-08-01T06:01:32.701Z","updated_at":"2025-05-15T22:12:08.724Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# is-stream\n\n\u003e Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)\n\n## Install\n\n```sh\nnpm install is-stream\n```\n\n## Usage\n\n```js\nimport fs from 'node:fs';\nimport {isStream} from 'is-stream';\n\nisStream(fs.createReadStream('unicorn.png'));\n//=\u003e true\n\nisStream({});\n//=\u003e false\n```\n\n## API\n\n### isStream(stream, options?)\n\nReturns a `boolean` for whether it's a [`Stream`](https://nodejs.org/api/stream.html#stream_stream).\n\n### isWritableStream(stream, options?)\n\nReturns a `boolean` for whether it's a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable), an [`http.OutgoingMessage`](https://nodejs.org/api/http.html#class-httpoutgoingmessage), an [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) or an [`http.ClientRequest`](https://nodejs.org/api/http.html#class-httpserverresponse).\n\n### isReadableStream(stream, options?)\n\nReturns a `boolean` for whether it's a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable) or an [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage).\n\n### isDuplexStream(stream, options?)\n\nReturns a `boolean` for whether it's a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex).\n\n### isTransformStream(stream, options?)\n\nReturns a `boolean` for whether it's a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform).\n\n### Options\n\n#### checkOpen\n\nType: `boolean`\\\nDefault: `true`\n\nWhen this option is `true`, the method returns `false` if the stream has already been closed.\n\n## Related\n\n- [is-file-stream](https://github.com/jamestalmage/is-file-stream) - Detect if a stream is a file stream\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Repository","JavaScript","模块","Modules"],"sub_categories":["Check/Detect","数据流-Stream","Stream"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fis-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-stream/lists"}