eval-slave
Dead simple node.js evaluator controlled via standart input
Install
With npm do:
npm install eval-slave
Or install globally if you want to add the node-eval-slave
executable:
npm install -g eval-slave
Usage
Check out the https://github.com/futpib/eval-slave/tree/master/examples dir
Abstract
- Start
node-eval-slave
ornode ./cli.js
- Write JSON array of "tasks" to the process's standard input
- Results will be printed as a JSON array to the standard output
You can even try it from shell!
Bash
echo '[{"source":"() => \"test\""}]' | node-eval-slave
Python
See https://github.com/futpib/eval-slave/tree/master/examples/foo.py
Emacs Lisp
(probably) Coming soon at https://github.com/futpib/emacs-nodejs-slave
Example
input (js, because real json is a bit too hairy):
id: 0 source: { return { } } arguments: "world" id: 1 source: "() => \"foobar\""
output (json):