UNPKG

394 BMarkdownView Raw
1# ensureDirSync(dir)
2
3Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`.
4
5**Aliases:** `mkdirsSync()`, `mkdirpSync()`
6
7- `dir` `<String>`
8
9## Example:
10
11```js
12const fs = require('fs-extra')
13
14const dir = '/tmp/this/path/does/not/exist'
15fs.ensureDirSync(dir)
16// dir has now been created, including the directory it is to be placed in
17```