Run a SpiderMonkey shell as a node child process.
var SM = ;var sm = shell: "js" ;sm;sm;sm;sm;sm;sm;sm;sm;sm; // request the end of sessionsm;
This module is a constructor with a single options object that recognizes one option:
shell="js": the path to the SpiderMonkey shell
The result of the constructor is an EventEmitter object with the following methods:
eval(src, callback): evaluates source with SpiderMonkey
load(path, callback): evaluates source from a file with SpiderMonkey
parse(src, callback): parses source with SpiderMonkey
parseFile(path, callback): parses contents of a file with SpiderMonkey
check(src, callback): checks source for valid syntax with SpiderMonkey
checkFile(path, callback): checks source from a file for valid syntax with SpiderMonkey
close: sends a message requesting SpiderMonkey to close down after finishing all pending actions
Each method sends a buffered message to SpiderMonkey requesting that it evaluate the corresponding action.
Each callback takes an error object signifying that SpiderMonkey threw an exception or an error occurred communicating with SpiderMonkey, or
null followed by a return value if the action returned normally.
"message": received a response from the SpiderMonkey shell
"exit": the SpiderMonkey shell has exited
Copyright © 2012 Dave Herman
Licensed under the MIT License.