paipu
Piapue is Japanese for Pipe, and it's also pipes library for Node.
Install
npm i paipu
Usage
You can throw anything into the pipe:
- Functions and Promises will be evaluated and the result will be the context for the next pipe
- Other pipes will extend the current pipe
- Anything else will set the context for the rest of the pipe
To execute a pipe, call resolve()
at the end of it.
Examples
Simple pipe:
const paipu = ; const result = await paipu ; // Result = 'hell'
Pipe with promises:
const paipu = ; const result = await paipu ; // Result = 'hell'
Pipe with nested pipes:
const paipu = ; const encrypt = paipu const result = await paipu ; // Result = 'bbddefg'
There are also before/after pipe hooks and aliases:
const paipu = ; paipu ;
And they will effect nested pipes too!
Contribution
Any type of feedback, pull request or issue is welcome