1// get current directory
2var cur_dir = process.cwd();
3console.log(cur_dir);
4// change current directory
5
6process.chdir('C:\\Projects\\experiments');
7console.log(process.cwd());
8
9// path.join for cross-platform paths:
10const path = require('path');
11process.chdir(path.join('C:', 'Projects', 'experiments'));
12console.log(process.cwd());
13process.exit();