create-symlink
v1.0.0
Published
Create a symbolic link
Downloads
1,129
Maintainers
Readme
create-symlink
A Node.js module to create a symbolic link
const createSymlink = require('create-symlink');
const {realpathSync} = require('fs');
createSymlink('/where/file/exists', 'where/to/create/symlink').then(() => {
realpathSync('where/to/create/symlink'); //=> '/where/file/exists'
});
Installation
npm install create-symlink
API
const createSymlink = require('create-symlink');
createSymlink(target, path [, option])
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.symlink
, but:
- Promisified
- The third parameter receives an object with
type
property, instead of receiving a string directly.
createSymlink('src', 'dest', {type: 'junction'}).then(() => {
// Created a junction point (Windows only)
});
License
Copyright (c) 2017 Shinnosuke Watanabe
Licensed under the MIT License.