Like mkdir -p, but in Node.js! Now with a modern API and no* bugs! * may contain some bugs example pow.js // hybrid module, import or require() both work import { mkdirp } from 'mkdirp' // or: const { mkdirp } = require('mkdirp') // return value is a Promise resolving to the first directory created mkdirp('/tmp/foo/bar/baz').then(made => console.log(`made directories, starting with ${made}`) ) Out