pipe-js
v1.0.0
Published
A backwards-compatible way of streamlining chained function calls in a readable and functional manner
Downloads
17
Maintainers
Readme
pipe-js
A backwards-compatible way of streamlining chained function calls in a readable and functional manner
Usage
const pipe = require('pipe-js')
const hello = 'hello'
const capitalize = str => str[0].toUpperCase() + str.substring(1)
const duplicate = str => `${str}-${str}`
const exclaim = str => str + '!'
pipe(hello).through(duplicate, capitalize, [String.prototype.concat, ' world'], exclaim) // Hello-hello world!