Wednesday 26 June 2019

How to execute a process with node and immediately get the right pid of the process

Hello everyone! I am trying to execute a webpack dev server. I need the pid of the server after I launch it. This is what I have, but the pid I get back does not correspond to the pid of the webpack dev server.const child_process = require("child_process"); x = child_process.exec("npm run webpack-dev-server"); console.log(x.pid);

Submitted June 26, 2019 at 11:37PM by goslingducks

No comments:

Post a Comment