# @undercut/push

> Lazy data processing and pipelines built around native JS Generators and Observers.

Latest version **0.6.1** (published 2020-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @undercut/push
pnpm add @undercut/push
yarn add @undercut/push
bun add @undercut/push
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2020-12-18 |
| First published | 2020-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 39 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Anton Alexandrenok |
| Maintainers | spyke |
| Keywords | array, es6, esm, esnext, filter, generator, iterable, iterator, itertools, lazy, linq, lodash, map, observer, pipeline, reduce, stdlib, underscore |

## Links

- npm: https://www.npmjs.com/package/@undercut/push
- Repository: https://github.com/the-spyke/undercut
- Homepage: https://undercut.js.org
- npm.io page: https://npm.io/package/@undercut/push

## Dependencies (1)

- [@undercut/utils](https://npm.io/package/@undercut/utils.md) ^0.6.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.6.1 (latest) — 2020-12-18
- 0.6.0 — 2020-07-21
- 0.5.1 — 2020-05-30
- 0.5.0 — 2020-01-08

## README

# @undercut/push

[![downloads](https://img.shields.io/npm/dm/@undercut/push)](https://www.npmjs.com/package/@undercut/push)
[![circleci](https://circleci.com/gh/the-spyke/undercut.svg?style=shield)](https://circleci.com/gh/the-spyke/undercut)
[![codecov](https://codecov.io/gh/the-spyke/undercut/branch/master/graph/badge.svg)](https://codecov.io/gh/the-spyke/undercut)
[![rms](https://img.shields.io/badge/RMS-0.3.0-blue)](https://github.com/the-spyke/rms)
[![license](https://img.shields.io/npm/l/undercut.svg)](https://github.com/the-spyke/undercut/blob/master/LICENSE)

Lazy data processing and pipelines built around native JS Generators and Observers. The code is universal and works in Node/browser/microwave.

- Based on existing JS protocols and language features
- Balanced API: not too imperative, not too functional
- Composability and extensibility by design
- Custom operations in a couple of lines
- Pure ES Modules with Node 14 loader compliance
- Lazy evaluation when possible
- Tree shaking friendliness
- No external dependencies
- TypeScript in JSDoc
- [RMS 0.3.0](https://github.com/the-spyke/rms)

Please visit [undercut.js.org](https://undercut.js.org) for broader overview and documentation.

## Usage

[![Undercut Demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/undercut-demo-1up46?fontsize=14&hidenavigation=1&moduleview=1&theme=dark&previewwindow=console&file=/push.js)

```js
import { pushLine, filter, map, skip, toConsumer } from "@undercut/push";

const pipeline = [skip(2), filter(x => x % 3), map(x => x * 2)];

const observer = pushLine(pipeline, toConsumer(x => console.log(x)));

console.log(`before`);

observer.next(1);
observer.next(2);
observer.next(3);
observer.next(4);

console.log(`in the middle`);

observer.next(5);
observer.next(6);
observer.next(7);

console.log(`after`);

observer.return();

```

## Prerequisites

The package is compliant with the [Raw Module Specification 0.3.0](https://github.com/the-spyke/rms) and provides original modern JavaScript code in the `ESM` format.

You may need to compile the code and/or load polyfills depending on your environment. Look for exact minimum versions of `@babel/preset-env` and `core-js` in the `package.json`.

Most modern apps already have such infrastructure or use similar tools. So most likely you don't have to do anything. If not, just add [Babel](https://babeljs.io/setup) to your build step.

## Installation

```sh
npm install @undercut/push
# or
yarn add @undercut/push
```

## Updating

As descibed in [RMS](https://github.com/the-spyke/rms): in case of upgrading the package to a newer version, please do so for `@babel/preset-env` and `core-js` too.

## License

Licensed under the MIT License, see [LICENSE](LICENSE) for more information.

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