The documentation states that the default value is 0777 & (~process.umask()) , which means that your umask value is "subtracted" from 0777. Since umask is usually 002 or 022, you end up with 0775 or 0755.
However, even if you grant permission 0777 to mkdirp() , the underlying system call will still apply the umask value. To avoid this, you need to clear umask, create the directory with the permission you need, and (optionally) restore umask to its previous value:
var oldmask = process.umask(0); mkdirp(new_location, '0777', function(err) { process.umask(oldmask); if (err) ... ... });
Alternatively, you can use fs.chmod() to set the correct permissions after creating the directory.
source share