I\'m trying to create a full path if it doesn\'t exist.
The code looks like this:
var fs = require(\'fs\');
if (!fs.existsSync(newDest)) fs.mkdirSync
fs-extra adds file system methods that aren't included in the native fs module. It is a drop in replacement for fs.
Install fs-extra
$ npm install --save fs-extra
const fs = require("fs-extra");
// Make sure the output directory is there.
fs.ensureDirSync(newDest);
There are sync and async options.
https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir.md