1.0.1 • Published 7 years ago

pipe-chain v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

pipe-chain

Build Status npm version MIT License

Simple chainable object.

Usage

// if use with nodejs then require('pipe-chain')
// if use with typescript then import 'pipe-chain'

{a:3,b:4,c:2}.pipe(Object.keys)      // -> ['a','b','c']
[3,4,5,2,8,6].pipe(v=>Math.min(...v) // -> 2
(3.63).pipe(Math.floor)              // -> 3
'filter'.pipe(v=>'-webkit-'+v)       // -> '-webkit-filter'

[6,4,8]
  .pipe(v=>Math.min(...v))          // ... 4
  .pipe(Math.sqrt)                  // -> 2

demo

Instal

npm install pipe-chain

Licence

MIT