const path = require('node:path');
const joined = path.join('users', 'alice', '..', 'bob', 'notes.txt');
console.log(joined); // users/bob/notes.txt (segments combined and normalized)
const resolved = path.resolve('users', 'bob', 'notes.txt');
console.log(resolved); // e.g. /home/project/users/bob/notes.txt (absolute path)
const resolvedFromRoot = path.resolve('/etc', 'config', 'app.json');
console.log(resolvedFromRoot); // /etc/config/app.json — stops once absolute