create-symlink

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i create-symlink

Weekly Downloads

415

Version

1.0.0

License

MIT

Last publish

Collaborators

  • shinnn