New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

effectuate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effectuate

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

0.3.2
latest
npm
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 06 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts