Skip to content

@vtj


@vtj / node / ensureSymlinkSync

Variable: ensureSymlinkSync() ​

const ensureSymlinkSync: (src, dest, type?) => void = fs.ensureSymlinkSync

Defined in: packages/node/src/fs.ts:21

Ensures that the symlink exists. If the directory structure does not exist, it is created.

Parameters ​

src ​

string

dest ​

string

type? ​

Type

It is only available on Windows and ignored on other platforms.

Returns ​

void

Example ​

ts
import * as fs from 'fs-extra'

const srcPath = '/tmp/file.txt'
const destPath = '/tmp/this/path/does/not/exist/file.txt'
fs.ensureSymlinkSync(srcPath, destPath)
// symlink has now been created, including the directory it is to be placed in