Reproduce:
const fs = require('fs');
const fx = require('mkdir-recursive');
const path = 'foo/bar/1';
console.log(fs.existsSync(path));
// fx.mkdirSync(path);
fx.mkdirSync(path, { recursive: true });
console.log(fs.existsSync('foo/'));
console.log(fs.existsSync(path));
Expected:
Actual:
Work-around:
Leave out the { recursive: true } option.
Note that this only affects mkdirSync, not mkdir.