I perform the basic operation when I start from a given directory and I go to the file system until I am at the root. On Linux / Mac, the root is obviously, /and on Windows it could be a C:\different drive name, of course. My question is whether there is a way for Node.js to determine what the root directory of the file system is.
Currently, I am resorting to simply checking the last s directory path.normalize(dir + "/../")to see if it stops changing. Is there a property / method process? Maybe a module?
source
share