diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee new file mode 100644 index 00000000..47e9b507 --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee @@ -0,0 +1,20 @@ +{spawn, execFile} = require "child_process" + +child = spawn "ls", ["-lF", "/rooot"] + +child.stdout.on "data", (data) -> + console.log "spawnSTDOUT:", JSON.stringify data + +child.stderr.on "data", (data) -> + console.log "spawnSTDERR:", JSON.stringify data + +child.on "exit", (code) -> + console.log "spawnEXIT:", code + +#child.kill "SIGKILL" + +execFile "ls", ["-lF", "/usr"], null, (err, stdout, stderr) -> + console.log "execFileSTDOUT:", JSON.stringify stdout + console.log "execFileSTDERR:", JSON.stringify stderr + +setTimeout (-> phantom.exit 0), 2000 |