Is your feature request related to a problem? Please describe.
It would be nice if child_process functionality, such as exec, had Promised based versions by default. Currently it does not, see https://nodejs.org/api/child_process.html
Describe the solution you'd like
A new child_process/promises import path that can be used similar to how fs promises are used:
// Using ESM Module syntax:
import { exec } from 'child_process/promises';
try {
const { stdout } = await exec(
'sysctl -n net.ipv4.ip_local_port_range'
);
console.log('successfully executed the child process command');
} catch (error) {
console.error('there was an error:', error.message);
}
Describe alternatives you've considered
I am already using const exec = util.promisify(process.exec); but that is not as nice. And this new proposal follows along what is happening in other Node.js APIs.
Is your feature request related to a problem? Please describe.
It would be nice if child_process functionality, such as
exec, had Promised based versions by default. Currently it does not, see https://nodejs.org/api/child_process.htmlDescribe the solution you'd like
A new
child_process/promisesimport path that can be used similar to how fs promises are used:Describe alternatives you've considered
I am already using
const exec = util.promisify(process.exec);but that is not as nice. And this new proposal follows along what is happening in other Node.js APIs.