2024-07-08
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Apud Node.js,path
Modulus processus fasciculi et convertendi vias.Sunt quidam communiterpath
Moduli methodi et earum descriptiones;
path.basename(path[, ext])
const path = require('path');
console.log(path.basename('/foo/bar/baz/asdf/quux.html')); // 输出: 'quux.html'
console.log(path.basename('/foo/bar/baz/asdf/quux.html', '.html')); // 输出: 'quux'
path.dirname(path)
const path = require('path');
console.log(path.dirname('/foo/bar/baz/asdf/quux.html')); // 输出: '/foo/bar/baz/asdf'
path.extname(path)
const path = require('path');
console.log(path.extname('/foo/bar/baz/asdf/quux.html')); // 输出: '.html'
path.join([...paths])
const path = require('path');
console.log(path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')); // 输出: '/foo/bar/baz/asdf'
path.resolve([...paths])
const path = require('path');
console.log(path.resolve('/foo/bar', './baz')); // 输出: '/foo/bar/baz'
console.log(path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')); // 输出: '/tmp/subfile'
path.isAbsolute(path)
const path = require('path');
console.log(path.isAbsolute('/foo/bar')); // 输出: true
console.log(path.isAbsolute('quux/')); // 输出: false
Hae methodi facultates validas praebent ad limandas vias ut lima et directoria procuratio faciliores reddant.In usumpath
modulus, tu prius uti debesrequire('path')
Introducet.