大气小土豆

文章
6
资源
2
加入时间
3年1月12天

node之path模块

//引用该模块var path = require("path");1、路径解析,得到规范化的路径格式//对window系统,目录分隔为'\', 对于UNIX系统,分隔符为'/',针对'..'返回上一级;/与\\都被统一转换//path.normalize(p);var myPath = path.normalize(__dirname + '/test/a//b//../c/