1The path module provides utilities for working with file and directory paths. It can be accessed using:
2
3const path = require('path');
1const path = require('path');
2
3path.parse('/home/user/dir/file.txt');
4// Returns:
5// { root: '/',
6// dir: '/home/user/dir',
7// base: 'file.txt',
8// ext: '.txt',
9// name: 'file' }