Pham Quỳnh
New member
How do you spawn in node JS?
Answer
The spawn function launches a command in a new process and we can use it to pass that command any arguments. For example, here’s code to spawn a new process that will execute the pwd command. const { spawn } = require
(‘child_process’); const child = spawn(‘pwd’);
Answer
The spawn function launches a command in a new process and we can use it to pass that command any arguments. For example, here’s code to spawn a new process that will execute the pwd command. const { spawn } = require
(‘child_process’); const child = spawn(‘pwd’);