node——获取URL路径文件扩展名

使用path模块的extname方法可以返回文件的扩展名

var path = require('path');
console.log(path.extname('123.txt'));  //.txt

猜你喜欢

转载自blog.csdn.net/YUHUI01/article/details/81677092
今日推荐