
const path = require('path');
// extname
console.log(path.extname('index.html')); // .html
console.log(path.extname('index.coffee.md')); // .md
// join
//
// console.log(path.join('a', 'b', 'c')); // a/b/c
// console.log(path.join('a', 'b', 'c', 'index.css')); // a/b/c/index.css
// a里面有b,b里面有../c,言外之意,c和b同级。
// console.log(path.join('a', 'b', '../c', 'index.js')); // a/c/index.js
// __dirname 永远表示当前js文件的绝对路径
console.log(path.join(__dirname, 'css', 'demo.css')); // /Users/tangfengpo/Study/123/Node01/code/css/demo.css