Shiyas Cholamukhath
Shiyas Cholamukhath

Reputation: 669

Node exec not working | v8.9.0

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

Answers (1)

Bill
Bill

Reputation: 73

You can use exec or execSync:

const {execSync} = require('child_process');
const output = execSync('dir').toString('utf8')

Upvotes: 0

Related Questions