index.js 188 B

123456789101112
  1. var fs = require('fs')
  2. , lstat = fs.lstatSync;
  3. exports.readlinkSync = function (p) {
  4. if (lstat(p).isSymbolicLink()) {
  5. return fs.readlinkSync(p);
  6. } else {
  7. return p;
  8. }
  9. };