1 var fs = require('graceful-fs')
3 function symlinkType (srcpath, type, callback) {
4 callback = (typeof type === 'function') ? type : callback
5 type = (typeof type === 'function') ? false : type
6 if (type) return callback(null, type)
7 fs.lstat(srcpath, function (err, stats) {
8 if (err) return callback(null, 'file')
9 type = (stats && stats.isDirectory()) ? 'dir' : 'file'
14 function symlinkTypeSync (srcpath, type) {
17 var stats = fs.lstatSync(srcpath)
21 return (stats && stats.isDirectory()) ? 'dir' : 'file'
25 symlinkType: symlinkType,
26 symlinkTypeSync: symlinkTypeSync