pipe-through

1.0.1 • Public • Published

pipe-through

Synchronously Pipe source Through filters/processors

Install

npm i pipe-through

Usage

This helper is for complex transforms. Here is a silly string transform example:

const pipes = require('pipe-through')
pipes(' string ', [
    (s) => s.trim(),
    (s) => s.substring(1)
])   // => 'tring'

API

pipeThrough( source, procs, ctx )

source

Type: any
Source object

procs

Type: Array of (source, ctx)=>result
Array of filters/processors

ctx

Type: any, optional
Context passed to filters
Usually, an object

LICENSE

MIT

Readme

Keywords

Package Sidebar

Install

npm i pipe-through

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.45 kB

Total Files

4

Last publish

Collaborators

  • wacky6