Node: path.isAbsolute()
Opened this issue · 0 comments
leslie1943 commented
判断当前路径是否为绝对路径
console.info(path.isAbsolute('foo')) // false
console.info(path.isAbsolute('/foo')) // true
console.info(path.isAbsolute('///foo')) // true
console.info(path.isAbsolute('')) // false
console.info(path.isAbsolute('.')) // false
console.info(path.isAbsolute('./foo')) // false
console.info(path.isAbsolute('../foo')) // false
console.info(path.isAbsolute(__dirname)) // true