Reputation: 669
Below code is not working for me. What is wrong here? I am in node v8.9.0
var exec = require('child_process').execFile; exec("dir");
Upvotes: 0
Views: 173
Reputation: 73
You can use exec
or execSync
:
const {execSync} = require('child_process');
const output = execSync('dir').toString('utf8')
Upvotes: 0