effectuate
Run exported function from any script passing in arguments from the command line. First argument can be passed in through stdin.
Last updated 4 years ago by iclanzan .
MIT · Original npm · Tarball · package.json
$ cnpm install effectuate 
SYNC missed versions from official npm registry.

Effectuate

Run exported function from any script passing in arguments from the command line. First argument can be passed in through stdin.

Install

$ npm install -g effectuate

Usage

Passing arguments

// multiply.js
module.exports = (a, b) => a * b
$ effectuate multiply 5 10
50

Named arguments

// getName.js
module.exports = config => config.first + ' ' + config.last
$ effectuate ./getName --first=John --last=Doe
John Doe

Using stdin

// double.js
module.exports = n => n * 2
$ echo 10 | effectuate-piped ./double
20

Can also provide stdin line by line:

$ echo -e "1\n2\n3" | effectuate-byline ./double
2
4
6

Returning a promise

// delay.js
module.exports = value => new Promise(
  resolve => setTimeout(() => resolve(value), 100)
)
$ effectuate ./delay foo
foo

Current Tags

  • 0.3.2                                ...           latest (4 years ago)

6 Versions

  • 0.3.2                                ...           4 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 5
Dependencies (5)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |