Skip to content

andrii-maglovanyi/pipe-js

Repository files navigation

pipe-js

Travis build Codecov coverage Version Downloads MIT license

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!

About

A backwards-compatible way of streamlining chained function calls in a readable and functional manner

Resources

License

Stars

Watchers

Forks

Packages

No packages published