Answers for "node js find directory change directory"

0

node js find directory change directory

// 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();
Posted by: Guest on December-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language