Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
const path = require('path'); // 1. Resolve relative to current working directory console.log(path.resolve('file.txt')); // 2. Resolve with multiple segments console.log(path.resolve('/users', 'docs', 'file.txt')); // 3. Right-to-left processing console.log(path.resolve('/first', '/second', 'third')); // '/second/third' // 4. Using __dirname for module-relative paths console.log(path.resolve(__dirname, 'config', 'app.json'));
/home/user/file.txt /users/docs/file.txt /second/third /home/users/config/app.json