# pipeoperator

> Pipelines for javascript. Inspired by the elixir pipe operator.

Latest version **0.1.1** (published 2017-10-04) · MIT license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2017-10-04 |
| First published | 2017-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Octavian Oncescu |
| Maintainers | octav445 |
| Keywords | pipe, pipeline, operator, elixir, pipe operator, pipeline operator, functional, functional programming |

## Links

- npm: https://www.npmjs.com/package/pipeoperator
- npm.io page: https://npm.io/package/pipeoperator

## 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.1.1 (latest) — 2017-10-04
- 0.1.0 — 2017-10-04
- 0.0.1 — 2017-10-04

## README

# pipeoperator

A library that creates pipelines in JavaScript. It works exactly like the pipe operator from Elixir or Bash.

## Installation

```
npm install pipeoperator
```

```js
import { pipeline } from 'pipeoperator';
```

## Usage

```js

const pipedValue = pipeline(value)
  .pipe(doSomething)
  .pipe(doSomethingElse)
  .pipe(doAnotherThing)
  .pipe(value => value.map(v => v.property))
  .result();
  
function doSomething(arg) { /* ... */ }
function doSomethingElse(arg) { /* ... */ }
function doAnotherThing(arg) { /* ... */ }
```

`pipe()` also takes additional arguments that are passed into the called function:

```js
const total = pipeline(1)
  .pipe(sum, 3, 2)
  .pipe(sum, 4)
  .result();

// total === 10

function sum(...args) {
  return args.reduce((total, number) => {
    return total + number;
  }, 0);
}
```

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