source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/child_process-examples.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 672 bytes
Line 
1var spawn = require("child_process").spawn
2var execFile = require("child_process").execFile
3
4var child = spawn("ls", ["-lF", "/rooot"])
5
6child.stdout.on("data", function (data) {
7 console.log("spawnSTDOUT:", JSON.stringify(data))
8})
9
10child.stderr.on("data", function (data) {
11 console.log("spawnSTDERR:", JSON.stringify(data))
12})
13
14child.on("exit", function (code) {
15 console.log("spawnEXIT:", code)
16})
17
18//child.kill("SIGKILL")
19
20execFile("ls", ["-lF", "/usr"], null, function (err, stdout, stderr) {
21 console.log("execFileSTDOUT:", JSON.stringify(stdout))
22 console.log("execFileSTDERR:", JSON.stringify(stderr))
23})
24
25setTimeout(function () {
26 phantom.exit(0)
27}, 2000)
Note: See TracBrowser for help on using the repository browser.