📅  最后修改于: 2022-03-11 15:03:22.104000             🧑  作者: Mango
// get current directory
var cur_dir = process.cwd();
console.log(cur_dir);
// change current directory
process.chdir('C:\\Projects\\experiments');
console.log(process.cwd());
// path.join for cross-platform paths:
const path = require('path');
process.chdir(path.join('C:', 'Projects', 'experiments'));
console.log(process.cwd());
process.exit();