Get the filename of a symlink's target
$ cnpm install get-link-target
Get the filename of a symlink's target
npm install --save get-link-target
const getLinkTarget = require('get-link-target')
getLinkTarget('path-to-symlink')
.then(targetPath => console.log(targetPath))
//> "/home/target"
.catch(err => console.error(err))
// or synchronously
getLinkTarget.sync('path-to-symlink')
//> "/home/target"
MIT © Zoltan Kochan
Copyright 2013 - present © cnpmjs.org | Home |