4 lines
200 B
JavaScript
4 lines
200 B
JavaScript
const path=require('path');
|
|
var testPath='f:code/node/chenxuan.js'
|
|
// path.dirname 返回路径的目录部分(去掉最后的文件名),结果为 f:code/node
|
|
console.log(path.dirname(testPath)) |