{"_id":"is-stream","_rev":"3220408","name":"is-stream","description":"Check if something is a Node.js stream","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-03-21T07:21:55.000Z","created":"2015-01-18T18:59:27.432Z","4.0.1":"2024-02-19T19:14:12.256Z","4.0.0":"2024-02-19T19:05:05.233Z","3.0.0":"2021-08-10T10:52:14.251Z","2.0.1":"2021-07-26T10:51:04.495Z","2.0.0":"2019-04-20T17:02:37.870Z","1.1.0":"2016-04-12T07:41:55.666Z","1.0.1":"2015-01-19T12:39:43.945Z","1.0.0":"2015-01-18T18:59:27.432Z"},"users":{"waynedpj":true,"monjer":true,"rocket0191":true,"nicknaso":true,"zhenguo.zhao":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"versions":{"4.0.1":{"name":"is-stream","version":"4.0.1","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"@types/node":"^20.11.19","ava":"^5.3.1","tempy":"^3.1.0","tsd":"^0.30.5","xo":"^0.57.0"},"types":"./index.d.ts","gitHead":"0868e196b222faa5e4b58c86c5bc6c480a94a966","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@4.0.1","_nodeVersion":"18.19.0","_npmVersion":"9.2.0","dist":{"shasum":"375cf891e16d2e4baec250b85926cffc14720d9b","size":2349,"noattachment":false,"key":"/is-stream/-/is-stream-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-stream_4.0.1_1708370052095_0.5622682672651913"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-02-19T19:14:12.256Z","publish_time":1708370052256,"_source_registry_name":"default","_cnpm_publish_time":1708370052256},"4.0.0":{"name":"is-stream","version":"4.0.0","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"@types/node":"^20.11.19","ava":"^5.3.1","tempy":"^3.1.0","tsd":"^0.30.5","xo":"^0.57.0"},"types":"./index.d.ts","gitHead":"29ddffc78580fea909e06b3fc2a0b2d3ba56da85","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@4.0.0","_nodeVersion":"18.19.0","_npmVersion":"9.2.0","dist":{"shasum":"3bd637761e6f9e9e30331744bcef71aba4c9a9f2","size":2387,"noattachment":false,"key":"/is-stream/-/is-stream-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-stream_4.0.0_1708369505088_0.4158994141219907"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-02-19T19:05:05.233Z","publish_time":1708369505233,"_source_registry_name":"default","_cnpm_publish_time":1708369505233},"3.0.0":{"name":"is-stream","version":"3.0.0","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"@types/node":"^16.4.13","ava":"^3.15.0","tempy":"^1.0.1","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"6913e344ab2dd63041bb7c03095876ce5a7e0a8b","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@3.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"shasum":"e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac","size":2220,"noattachment":false,"key":"/is-stream/-/is-stream-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-stream_3.0.0_1628592734094_0.10015535082882487"},"_hasShrinkwrap":false,"publish_time":1628592734251,"_cnpm_publish_time":1628592734251},"2.0.1":{"name":"is-stream","version":"2.0.1","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"@types/node":"^11.13.6","ava":"^1.4.1","tempy":"^0.3.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"fb8caed475b4107cee3c22be3252a904020eb2d4","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@2.0.1","_nodeVersion":"16.2.0","_npmVersion":"7.10.0","dist":{"shasum":"fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077","size":2222,"noattachment":false,"key":"/is-stream/-/is-stream-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-2.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-stream_2.0.1_1627296664370_0.3696773205895987"},"_hasShrinkwrap":false,"publish_time":1627296664495,"_cnpm_publish_time":1627296664495},"2.0.0":{"name":"is-stream","version":"2.0.0","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"@types/node":"^11.13.6","ava":"^1.4.1","tempy":"^0.3.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"1a70a7f985a00bf25de8437e68c849bf0e434bfb","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@2.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bde9c32680d6fae04129d6ac9d921ce7815f78e3","size":2080,"noattachment":false,"key":"/is-stream/-/is-stream-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-stream_2.0.0_1555779757689_0.1309729016157941"},"_hasShrinkwrap":false,"publish_time":1555779757870,"_cnpm_publish_time":1555779757870},"1.1.0":{"name":"is-stream","version":"1.1.0","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-stream.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["stream","type","streams","writable","readable","duplex","transform","check","detect","is"],"devDependencies":{"ava":"*","tempfile":"^1.1.0","xo":"*"},"gitHead":"e21d73f1028c189d16150cea52641059b0936310","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream#readme","_id":"is-stream@1.1.0","_shasum":"12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44","size":1616,"noattachment":false,"key":"/is-stream/-/is-stream-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-stream-1.1.0.tgz_1460446915184_0.806101513793692"},"directories":{},"publish_time":1460446915666,"_cnpm_publish_time":1460446915666,"_hasShrinkwrap":false},"1.0.1":{"name":"is-stream","version":"1.0.1","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-stream"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["stream","streams","writable","readable","duplex","check","detect","is","type"],"devDependencies":{"ava":"0.0.4","tempfile":"^1.1.0"},"gitHead":"424a6904c768f5f446fbc36c03a31be8b1209ca6","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream","_id":"is-stream@1.0.1","_shasum":"b44ce45b1f0c3df583f6b5debf84dcf9743ac8b5","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"b44ce45b1f0c3df583f6b5debf84dcf9743ac8b5","size":889,"noattachment":false,"key":"/is-stream/-/is-stream-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-1.0.1.tgz"},"directories":{},"publish_time":1421671183945,"_cnpm_publish_time":1421671183945,"_hasShrinkwrap":false},"1.0.0":{"name":"is-stream","version":"1.0.0","description":"Check if something is a Node.js stream","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-stream"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["stream","streams","writable","readable","duplex","check","detect","is","type"],"devDependencies":{"ava":"0.0.4","tempfile":"^1.1.0"},"gitHead":"a5327fd78cff686b4a9e32e676e179b620fa748b","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"homepage":"https://github.com/sindresorhus/is-stream","_id":"is-stream@1.0.0","_shasum":"aa0ce914e0e917064222acf7ddf6140d718865d7","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"aa0ce914e0e917064222acf7ddf6140d718865d7","size":874,"noattachment":false,"key":"/is-stream/-/is-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-stream/download/is-stream-1.0.0.tgz"},"directories":{},"publish_time":1421607567432,"_cnpm_publish_time":1421607567432,"_hasShrinkwrap":false}},"readme":"# is-stream\n\n> 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//=> true\n\nisStream({});\n//=> 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","_attachments":{},"homepage":"https://github.com/sindresorhus/is-stream#readme","bugs":{"url":"https://github.com/sindresorhus/is-stream/issues"},"license":"MIT"}