# duplexpair

> Make a full duplex stream with 2 Duplex endpoints

Latest version **1.0.2** (published 2024-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install duplexpair
pnpm add duplexpair
yarn add duplexpair
bun add duplexpair
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-03-07 |
| First published | 2018-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Anna Henningsen |
| Maintainers | addaleax |
| Keywords | duplex, pair, streams, socket |

## Links

- npm: https://www.npmjs.com/package/duplexpair
- Repository: https://github.com/addaleax/duplexpair
- Homepage: https://github.com/addaleax/duplexpair#readme
- Issues: https://github.com/addaleax/duplexpair/issues
- npm.io page: https://npm.io/package/duplexpair

## Dependencies (1)

- [readable-stream](https://npm.io/package/readable-stream.md) ^4.5.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-03-07
- 1.0.1 — 2018-01-06
- 1.0.0 — 2018-01-06

## README

duplexpair
==============

[![NPM Version](https://img.shields.io/npm/v/duplexpair.svg?style=flat)](https://npmjs.org/package/duplexpair)
[![NPM Downloads](https://img.shields.io/npm/dm/duplexpair.svg?style=flat)](https://npmjs.org/package/duplexpair)
[![Build Status](https://travis-ci.org/addaleax/duplexpair.svg?style=flat&branch=master)](https://travis-ci.org/addaleax/duplexpair?branch=master)
[![Coverage Status](https://coveralls.io/repos/addaleax/duplexpair/badge.svg?branch=master)](https://coveralls.io/r/addaleax/duplexpair?branch=master)
[![Dependency Status](https://david-dm.org/addaleax/duplexpair.svg?style=flat)](https://david-dm.org/addaleax/duplexpair)

Make a full duplex stream with 2 Duplex endpoints.

Install:
`npm install duplexpair`

```js
const DuplexPair = require('duplexpair');

const { socket1, socket2 } = new DuplexPair();

socket1.write('Hi');
console.log(socket2.read());  // => <Buffer 48 69>

// Or, using options that are passed to the Duplex constructor:

const { socket1, socket2 } = new DuplexPair({ encoding: 'utf8' });

socket1.write('Hi');
console.log(socket2.read());  // => 'Hi'
```

License
=======

MIT

---
_Source: https://npm.io/package/duplexpair · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
