https://github.com/bendrucker/value-pipe
Pipe a value through a list of synchronous transform functions
https://github.com/bendrucker/value-pipe
Last synced: 9 months ago
JSON representation
Pipe a value through a list of synchronous transform functions
- Host: GitHub
- URL: https://github.com/bendrucker/value-pipe
- Owner: bendrucker
- License: mit
- Created: 2015-08-01T17:01:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T21:47:40.000Z (almost 7 years ago)
- Last Synced: 2025-04-10T08:14:08.517Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# value-pipe [](https://travis-ci.org/bendrucker/value-pipe) [](https://greenkeeper.io/)
> Pipe a value through a list of synchronous transform functions
## Install
```
$ npm install --save value-pipe
```
## Usage
```js
var pipe = require('value-pipe')
var mirrorAndUppercase = pipe(mirror, uppercase)
mirrorAndUppercase('git')
//=> GITTIG
function mirror (value) {
return value + value.split('').reverse().join('')
}
function uppercase (value) {
return value.toUpperCase()
}
```
## API
#### `pipe(functions...)` -> `function`
##### functions
*Required*
Type: `function` / `array[function]`
A set of functions to use to transform the value. At least one is required. You can pass the functions as arguments or pass a single array of functions.
## License
MIT © [Ben Drucker](http://bendrucker.me)