获取您自己的 Node 服务器
var path = require('path');
//Return the extension:
var ext = path.extname('/Users/Refsnes/demo_path.js');
console.log(ext);

              

.js