Make a directory if none exists

node
var mkdirp = require('mkdirp')
mkdirp('/tmp/some/path/foo', err => {
// path exists unless there was an error
})
Edit this page
Want to make your own site like this? Try gatsby-theme-code-notes by Zander Martineau.
Notes on code. My memory bank.