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

duplexer3

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplexer3

Modern version of `duplexer2`

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.6M
increased by5.79%
Maintainers
2
Weekly downloads
 
Created

What is duplexer3?

The duplexer3 npm package is used to create a duplex stream that combines a writable and readable stream into a single stream. This is useful when you need to expose a single stream interface while internally piping data between two separate streams, such as a process's stdin and stdout.

What are duplexer3's main functionalities?

Combining writable and readable streams

This code sample demonstrates how to create a duplex stream by combining a writable and a readable stream using duplexer3. The resulting duplexStream can be used to read from and write to, acting as a bridge between the two streams.

const { Duplex } = require('stream');
const duplexer3 = require('duplexer3');

const writable = new Duplex({
  write(chunk, encoding, callback) {
    // Write logic here
    callback();
  }
});

const readable = new Duplex({
  read(size) {
    // Read logic here
  }
});

const duplexStream = duplexer3(writable, readable);

// Now duplexStream can be used as both a writable and readable stream.

Other packages similar to duplexer3

Keywords

FAQs

Package last updated on 07 Jul 2022

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