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
What you want is path.basename:
path.basename(path.dirname(filename))