{"id":13526662,"url":"https://github.com/rvagg/isstream","last_synced_at":"2025-04-05T21:11:13.638Z","repository":{"id":15763480,"uuid":"18502328","full_name":"rvagg/isstream","owner":"rvagg","description":"Determine if an object is a Node.js Stream","archived":false,"fork":false,"pushed_at":"2015-12-30T12:19:22.000Z","size":44,"stargazers_count":63,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T20:09:10.920Z","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/rvagg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-07T00:04:08.000Z","updated_at":"2024-10-21T00:27:09.000Z","dependencies_parsed_at":"2022-08-29T08:51:20.861Z","dependency_job_id":null,"html_url":"https://github.com/rvagg/isstream","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fisstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fisstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fisstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fisstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvagg","download_url":"https://codeload.github.com/rvagg/isstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399885,"owners_count":20932880,"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.870Z","updated_at":"2025-04-05T21:11:13.606Z","avatar_url":"https://github.com/rvagg.png","language":"JavaScript","readme":"# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable())    // true\nisStream(new Stream.Writable())    // true\nisStream(new Stream.Duplex())      // true\nisStream(new Stream.Transform())   // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream())   // false\n\nisReadable(new Stream.Readable())    // true\nisReadable(new Stream.Writable())    // false\nisReadable(new Stream.Duplex())      // true\nisReadable(new Stream.Transform())   // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable())    // false\nisWritable(new Stream.Writable())    // true\nisWritable(new Stream.Duplex())      // true\nisWritable(new Stream.Transform())   // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable())    // false\nisDuplex(new Stream.Writable())    // false\nisDuplex(new Stream.Duplex())      // true\nisDuplex(new Stream.Transform())   // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n","funding_links":[],"categories":["Repository","JavaScript","Modules"],"sub_categories":["Check/Detect"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvagg%2Fisstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvagg%2Fisstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvagg%2Fisstream/lists"}