Files
modernjs/chapter03/src/process_spawn.js
T
2018-04-11 15:29:50 -03:00

17 lines
335 B
JavaScript

/* @flow */
"use strict";
const path = require("path");
const { spawn } = require("child_process");
const child = spawn("node", [path.resolve("out/process_spawn_dir.js")]);
child.stdin.write("/home/fkereki");
child.stdout.on("data", data => {
console.log(String(data));
});
child.stdout.on("end", () => {
child.kill();
});