I am using Node.js, and I want to obtain the parent directory name for a file. I have the file \"../test1/folder1/FolderIWant/test.txt\".
\"../test1/folder1/FolderIWant/test.txt\"
I want to get
const path = require('path'); module.exports = path.dirname(process.mainModule.filename)
Use this anywhere to get the root directory