June 2025
Intermediate to advanced
837 pages
24h 50m
English
You can use the spawn, exec, and execFile methods of the child_process module to execute commands independently of Node.js. Via these methods, you can use all the commands available to you on the command line of your operating system as well.
Using these running commands has the advantage that you can directly access the functionality of the operating system or utilities without laboriously implementing the functionality in JavaScript first. In Node.js, you can control the behavior via options and get access to the output of each executed command.
The simpler of the two variants for executing external commands is to use the two exec commands. Listing 16.5 shows an example ...
Read now
Unlock full access