A Node.js module to create a symbolic link
const createSymlink = require('create-symlink');
const {realpath} = require('fs').promises;
(async () => {
await createSymlink('/where/file/exists', 'where/to/create/symlink');
await realpath('where/to/create/symlink'); //=> '/where/file/exists'
})();npm install create-symlink
const createSymlink = require('create-symlink');target: string (symlink target)
path: string (a path where you create a symlink)
option: Object
Return: Promise
Almost the same as the built-in fs.promises.symlink(), but the third parameter receives an object with type property, instead of receiving a string directly.
(async () => {
await createSymlink('src', 'dest', {type: 'junction'});
// Created a junction point (Windows only)
})();ISC License © 2018 Shinnosuke Watanabe