Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/ECMAScript/
Node JS
Node JS
/Node.js Abstract/Node.js process Variable/
Node.js Directory
Search

Node.js Directory

  • process.cwd() === ./
  • process.chdir() - change working directory
Get the current folder in Node
There are basically two ways to reference the current folder in a Node.js script: Along with ./, there is ../, which points to the parent folder. They behave in the same way. There is a big difference between the two. Using __dirname in a Node script will return the path of the folder where the current JavaScript file resides.
Get the current folder in Node
https://flaviocopes.com/node-get-current-folder/
Get the current folder in Node
 
There are basically two ways to reference the current folder in a Node.js script:
  • ./
  • __dirname
 
 
 

Recommendations

Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/ECMAScript/
Node JS
Node JS
/Node.js Abstract/Node.js process Variable/
Node.js Directory
Copyright Seonglae Cho