create-symlink

Create a symbolic link

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
create-symlink
301.0.06 years ago6 years agoMinified + gzip package size for create-symlink in KB

Readme

create-symlink
NPM version Build Status Coverage Status
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

Use npm.
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.