Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isstream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isstream

Determine if an object is a Stream

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18M
decreased by-11.67%
Maintainers
1
Weekly downloads
 
Created

What is isstream?

The isstream npm package is a simple utility to check if an object is a stream. It provides functions to determine if an object is a readable, writable, or duplex stream.

What are isstream's main functionalities?

Check if an object is a stream

This feature allows you to check if a given object is a stream. In this example, we use the fs module to create a readable stream and then check if it is a stream using isStream.

const isStream = require('isstream');
const fs = require('fs');

const readableStream = fs.createReadStream('example.txt');
console.log(isStream(readableStream)); // true

Check if an object is a readable stream

This feature allows you to check if a given object is a readable stream. In this example, we use the fs module to create a readable stream and then check if it is a readable stream using isStream.isReadable.

const isStream = require('isstream');
const fs = require('fs');

const readableStream = fs.createReadStream('example.txt');
console.log(isStream.isReadable(readableStream)); // true

Check if an object is a writable stream

This feature allows you to check if a given object is a writable stream. In this example, we use the fs module to create a writable stream and then check if it is a writable stream using isStream.isWritable.

const isStream = require('isstream');
const fs = require('fs');

const writableStream = fs.createWriteStream('example.txt');
console.log(isStream.isWritable(writableStream)); // true

Check if an object is a duplex stream

This feature allows you to check if a given object is a duplex stream. In this example, we create a duplex stream using the stream module and then check if it is a duplex stream using isStream.isDuplex.

const isStream = require('isstream');
const { Duplex } = require('stream');

const duplexStream = new Duplex();
console.log(isStream.isDuplex(duplexStream)); // true

Other packages similar to isstream

Keywords

FAQs

Package last updated on 07 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc