npm.io
4.0.0 • Published 5 months ago

root-link-target

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

Gets the shortest directory to which a file can be linked

npm version

Installation

<npm|yarn|pnpm> add root-link-target

Usage

const rootLinkTarget = require('root-link-target')

rootLinkTarget.sync('C:\\sub\\dir\\foo.txt')
//> C:\\

API

rootLinkTarget.sync(filename): string

Returns the shortest directory to which filename can be linked

rootLinkTarget(filename): Promise<string>

License

MIT Zoltan Kochan

Keywords