1 | # ensureSymlinkSync(srcpath, dstpath, [type])
|
2 |
|
3 | Ensures that the symlink exists. If the directory structure does not exist, it is created.
|
4 |
|
5 | - `srcpath` `<String>`
|
6 | - `dstpath` `<String>`
|
7 | - `type` `<String>`
|
8 |
|
9 | ## Example:
|
10 |
|
11 | ```js
|
12 | const fs = require('fs-extra')
|
13 |
|
14 | const srcpath = '/tmp/file.txt'
|
15 | const dstpath = '/tmp/this/path/does/not/exist/file.txt'
|
16 | fs.ensureSymlinkSync(srcpath, dstpath)
|
17 | // symlink has now been created, including the directory it is to be placed in
|
18 | ```
|