1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
path.normalize('/1/../2');
path.join('a', 'b'); path.join('a', './b'); path.join('a', '/b'); path.join('/1', '/2/3', '../4');
path.resolve('/from', '/to/path1', '/to/path2'); path.isAbsolute('/');
path.relative('..', './A/B');
path.dirname('node_modules/bin/webpack'); path.dirname('./node_modules/bin/webpack');
path.basename('node_modules/bin/webpack'); path.basename('/1/2/3.js');
path.extname('/1/2/3.js');
path.parse('/1/2/3.js');
path.format({ root: '/', dir: '/1/2', base: '3.js', ext: '.js', name: '3' });
|