Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobbubu/multiplex-pull
https://github.com/jacobbubu/multiplex-pull
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobbubu/multiplex-pull
- Owner: jacobbubu
- License: mit
- Created: 2019-10-30T09:44:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:45:43.000Z (about 2 years ago)
- Last Synced: 2024-12-14T08:44:16.538Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 521 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# @jacobbubu/multiplex-pull
[![Build Status](https://travis-ci.org/jacobbubu/multiplex-pull.svg)](https://travis-ci.org/NXMIX/jacobbubu/multiplex-pull)
[![Coverage Status](https://coveralls.io/repos/github/NXMIX/jacobbubu/multiplex-pull/badge.svg)](https://coveralls.io/github/jacobbubu/multiplex-pull)
[![npm](https://img.shields.io/npm/v/@jacobbubu/multiplex-pull.svg)](https://www.npmjs.com/package/@jacobbubu/multiplex-pull/)> A [multiplex](https://github.com/maxogden/multiplex) impementation that uses [pull-stream](https://github.com/pull-stream/pull-stream).
### Usage
```bash
npm install @jacobbubu/multiplex-pull
npm run example.ex1
``````ts
import * as pull from 'pull-stream'
import { Multiplex, Channel } from '@jacobbubu/multiplex-pull'const plex1 = new Multiplex()
const plex2 = new Multiplex(null, (channel: Channel, name: string) => {
pull(
channel.source,
pull.collect((err, result) => {
expect(err).toBeFalsy()
expect(result.toString()).toEqual('plex1')
done()
})
)
})pull(p1.source, p2.sink)
pull(p2.source, p1.sink)pull(pull.values(['plex1']), channelAt1.sink)
```