UNPKG

468 BMarkdownView Raw
1# ensureSymlinkSync(srcpath, dstpath, [type])
2
3Ensures 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
12const fs = require('fs-extra')
13
14const srcpath = '/tmp/file.txt'
15const dstpath = '/tmp/this/path/does/not/exist/file.txt'
16fs.ensureSymlinkSync(srcpath, dstpath)
17// symlink has now been created, including the directory it is to be placed in
18```