const exec = require('child-process-promise').exec; module.exports = function (docxFile, image){ return new Promise ((resolve, reject)=>{ exec('mkdir word/media') .then(function (result) { var stdout = result.stdout; var stderr = result.stderr; console.log('stdout: ', stdout); console.log('stderr: ', stderr); }) .catch(function (err) { console.error('ERROR: ', err); }); } )}