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