1 {spawn, execFile} = require "child_process"
3 child = spawn "ls", ["-lF", "/rooot"]
5 child.stdout.on "data", (data) ->
6 console.log "spawnSTDOUT:", JSON.stringify data
8 child.stderr.on "data", (data) ->
9 console.log "spawnSTDERR:", JSON.stringify data
11 child.on "exit", (code) ->
12 console.log "spawnEXIT:", code
16 execFile "ls", ["-lF", "/usr"], null, (err, stdout, stderr) ->
17 console.log "execFileSTDOUT:", JSON.stringify stdout
18 console.log "execFileSTDERR:", JSON.stringify stderr
20 setTimeout (-> phantom.exit 0), 2000