npm.io
3.0.0 • Published 5 months ago

can-link

Licence
MIT
Version
3.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
104

Returns true if a link can be created

npm version

Installation

<npm|yarn|pnpm> add can-link

Usage

const canLink = require('can-link')

canLink.sync('C:\\foo.txt', 'D:\\foo.txt')
//> false

canLink.sync('C:\\foo.txt', 'C:\\dir\\foo.txt')
//> true

API

canLink.sync(existingPath, newPath): Boolean

Returns true if fs.linkSync(existingPath, newPath) is able to create a link.

canLink(existingPath, newPath): Promise<Boolean>

Returns true if fs.link(existingPath, newPath) is able to create a link.

License

MIT Zoltan Kochan

Keywords