Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 30, 2024 via pnpm

duplexify 3.7.1

Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input
Package summary
Share
0
issues
2
licenses
10
MIT
3
ISC
Package created
7 Jul 2014
Version published
4 Feb 2019
Maintainers
1
Total deps
13
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
core-util-is@1.0.3
duplexify@3.7.1
end-of-stream@1.4.4
isarray@1.0.0
process-nextick-args@2.0.1
readable-stream@2.3.8
safe-buffer@5.1.2
stream-shift@1.0.3
string_decoder@1.1.1
util-deprecate@1.0.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
inherits@2.0.4
once@1.4.0
wrappy@1.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of duplexify 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
end-of-stream1.4.42.33 kBMIT
prod
inherits2.0.41.98 kBISC
prod
readable-stream2.3.825.14 kBMIT
prod
stream-shift1.0.32 kBMIT
prod

Visualizations

Frequently Asked Questions

What does duplexify do?

Duplexify is a utility that converts a writable and readable stream into a unified streams2 duplex stream. It is particularly useful because it supports both streams2 and streams1 inputs. Additionally, duplexify allows for the asynchronous setting of the readable and writable parts via the 'setReadable(stream)' and 'setWritable(stream)' functions.

How do you use duplexify?

To use duplexify, you can follow the steps below:

Firstly, install the duplexify package with npm:

npm install duplexify 

Once you have the package, you can implement it into your JavaScript file. Here is a basic usage example:

var duplexify = require('duplexify')

// turn writableStream and readableStream into a single duplex stream
var dup = duplexify(writableStream, readableStream)

dup.write('hello world') // will write to writableStream
dup.on('data', function(data) {
  // will read from readableStream
})

You can also use duplexify to set the readable and writable parts asynchronously:

var dup = duplexify()

dup.write('hello world') // write will buffer until the writable
                         // part has been set

// wait a bit ...
dup.setReadable(readableStream)

// maybe wait some more?
dup.setWritable(writableStream)

If either the readable or writable streams emit an error or close, duplexify will destroy both streams and surface the event. You can manually destroy the streams by calling 'dup.destroy()'.

Where are the duplexify docs?

Documentation for duplexify can be found directly on its GitHub page. This includes information on usage, examples, and even a guide on turning a core http request into a duplex stream.