path路径操作模块
path.basename()
path.dirname('c:/a/b/c/d/index.js')
'c:/a/b/c/d'
path.extname()
path.extname('c:/a/b/c/d/index.js')
'.js'
path.isAbsolute(path)
> path.isAbsolute('C:/A/B/C/S')
true
> path.isAbsolute('/A/B/C/S')
true
> path.isAbsolute('./A/B/C/S')
false
> path.isAbsolute('A/B/C/S')
false
path.join('c:/a','b')
'c:\\a\\b'
{
resolve: [Function: resolve],
normalize: [Function: normalize],
isAbsolute: [Function: isAbsolute],
join: [Function: join],
relative: [Function: relative],
toNamespacedPath: [Function: toNamespacedPath],
dirname: [Function: dirname],
basename: [Function: basename],
extname: [Function: extname],
format: [Function: bound _format],
parse: [Function: parse],
sep: '\\',
delimiter: ';',
win32: [Circular],
posix: {
resolve: [Function: resolve],
normalize: [Function: normalize],
isAbsolute: [Function: isAbsolute],
join: [Function: join],
relative: [Function: relative],
toNamespacedPath: [Function: toNamespacedPath],
dirname: [Function: dirname],
basename: [Function: basename],
extname: [Function: extname],
format: [Function: bound _format],
parse: [Function: parse],
sep: '/',
delimiter: ':',
win32: [Circular],
posix: [Circular],
_makeLong: [Function: toNamespacedPath]
},
_makeLong: [Function: toNamespacedPath]
}
- basename
- dirname
- extname
- parse
- join
网友评论