tree: 6333f215b905fdb81200efbcee58a8a6d0d27c39 [path history] [tgz]
  1. README.md
  2. test.js
node-local/README.md

Testing node.js functions locally

Usage:

node test.js ./path-to-function.js parameter=value parameter2=value2

Will invoke the main function of path-to-function.js with following params:

{
  "parameter":"value",
  "parameter2":"value"
}

Alternatively, input can be passed on stdin, this allows the creation of more complex input objects that would be inconvenient to edit on the command line or passing non-string values.

echo '{"boolean": true}' | node test.js ./path-to-function.js
cat input.json | node test.js ./path-to-function.js