Node.js path 模块 ES6 RegExp match() ES6 RegExp replace() Node.js path 模块 var path = require("path"); // Normalization console.log('normalization : ' + path.normalize('/test/test1//2slashes/1slash/tab/..')); // Join console.log('joint path : ' + path.join('/test', 'test1', '2slashes/1slash', 'tab', '..')); // Resolve console.log('resolve : ' + path.resolve('main.js')); // extName console.log('ext name : ' + path.extname('main.js')); ES6 RegExp match() ES6 RegExp replace()