root-link-target
Gets the shortest directory to which a file can be linked
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