MKGaru / pipe-chain

Simple chainable object.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Simple chainable object.

License:MIT License


Languages

Language:TypeScript 84.7%Language:JavaScript 15.3%