# highland-set

> Union and Intersection operators for highland.js streams

Latest version **0.0.1** (published 2017-01-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install highland-set
pnpm add highland-set
yarn add highland-set
bun add highland-set
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-01-12 |
| First published | 2017-01-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Adriaan Pelzer |
| Maintainers | 4dr144n |
| Keywords | highland, set, theory, streams, intersection, union |

## Links

- npm: https://www.npmjs.com/package/highland-set
- Repository: https://github.com/adriaan-pelzer/highland-set
- Homepage: https://github.com/adriaan-pelzer/highland-set#readme
- Issues: https://github.com/adriaan-pelzer/highland-set/issues
- npm.io page: https://npm.io/package/highland-set

## Dependencies (1)

- [highland](https://npm.io/package/highland.md) ^2.10.1

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-01-12

## README

# highland-set

## Union and Intersection operators for highland.js streams

This is a utility library for [@coalan](https://github.com/caolan)'s briliant functional wrapper for Node.js streams, [highland](http://highlandjs.org). It exposes two methods, *intersection* and *union*, both of which takes an array of highland streams as input. It outputs a highland stream, which emits the intersection, or union, of all the streams, if you view each stream as a set.

### INSTALL

```
    npm install highland-set
```

### USE

```
    const highlandSet = require ( 'highland-set' );

    highlandSet.intersection ( [
        H ( [ 1, 2, 3, 4, 5 ] ),
        H ( [ 1, 2, 3 ] ),
        H ( [ 1, 3, 4 ] ),
        // And an asynchronous one, otherwise, why would you use streams?
        H ( ( push, next ) => {
            [ 1, 2, 3, 4, 5, H.nil ].forEach ( ( item, index ) => {
                setTimeout ( () => {
                    push ( null, item );
                }, index * 1000 );
            } );
        } )
    ] )
        .each ( console.log );
        // emits 1, 3

    highlandSet.union ( [
        H ( [ 1, 2, 3, 4, 5 ] ),
        H ( [ 1, 2, 3 ] ),
        H ( [ 1, 3, 4 ] ),
        // And an asynchronous one, otherwise, why would you use streams?
        H ( ( push, next ) => {
            [ 1, 2, 3, 4, 5, H.nil ].forEach ( ( item, index ) => {
                setTimeout ( () => {
                    push ( null, item );
                }, index * 1000 );
            } );
        } )
    ] )
        .each ( console.log );
        // emits 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 1, 2, 3, 4, 5
        // (note the asynchronous ones are at the end)
```

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