6.0.3 • Published 1 year ago
symlink-dir v6.0.3
symlink-dir
Cross-platform directory symlinking
- Always uses "junctions" on Windows. Even though support for "symbolic links" was added in Vista+, users by default lack permission to create them
- Any file or directory, that has the destination name, is renamed before creating the link
Installation
pnpm add symlink-dirCLI Usage
Lets suppose you'd like to self-require your package. You can link it to its own node_modules:
# from -> to
symlink-dir . node_modules/my-packageAPI Usage
'use strict'
const symlinkDir = require('symlink-dir')
const path = require('path')
symlinkDir('src', 'node_modules/src')
.then(result => {
console.log(result)
//> { reused: false }
return symlinkDir('src', 'node_modules/src')
})
.then(result => {
console.log(result)
//> { reused: true }
})
.catch(err => console.error(err))API
symlinkDir(target, path, opts?): Promise<{ reused: boolean, warn?: string }>
symlinkDir.sync(target, path, opts?): { reused: boolean, warn?: string }
Creates the link called path pointing to target.
Options:
overwrite- boolean - istrueby default. Whenfalse, existing files at dest are not overwritten.
Result:
reused- boolean - istrueif the symlink already existed pointing to thetarget.warn- string - any issues that happened during linking (it does mean a failure).
License
6.0.3
1 year ago
6.0.1
1 year ago
6.0.2
1 year ago
6.0.0
2 years ago
5.2.1
2 years ago
5.2.0
2 years ago
5.1.1
3 years ago
5.0.2
3 years ago
5.1.0
3 years ago
5.0.1
5 years ago
5.0.0
5 years ago
4.2.0
5 years ago
4.1.0
5 years ago
4.0.3
6 years ago
4.0.2
6 years ago
4.0.1
6 years ago
4.0.0
6 years ago
3.1.2
6 years ago
3.1.1
6 years ago
3.1.0
6 years ago
3.0.3
7 years ago
3.0.2
7 years ago
3.0.1
7 years ago
3.0.0
7 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.1.3
7 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.3
8 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago