Open this example in the interactive library
Source code
import { posix as path } from "node:path";
console.log(path.parse("/var/log/app.log"));
Sample output
{
root: '/',
dir: '/var/log',
base: 'app.log',
ext: '.log',
name: 'app'
}
Open this example in the interactive library
import { posix as path } from "node:path";
console.log(path.parse("/var/log/app.log"));
{
root: '/',
dir: '/var/log',
base: 'app.log',
ext: '.log',
name: 'app'
}