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