1 | # ensureDirSync(dir)
|
2 |
|
3 | Ensures 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
|
12 | const fs = require('fs-extra')
|
13 |
|
14 | const dir = '/tmp/this/path/does/not/exist'
|
15 | fs.ensureDirSync(dir)
|
16 | // dir has now been created, including the directory it is to be placed in
|
17 | ```
|