value-pipe
Pipe a value through a list of sync transform functions
Last updated 3 years ago by bendrucker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install value-pipe 
SYNC missed versions from official npm registry.

value-pipe Build Status

Pipe a value through a list of synchronous transform functions

Install

$ npm install --save value-pipe

Usage

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

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2016 © taobao.org |