Answer by JohnnyHK for Node: How to get the dirname where a script was called...
What you want is process.cwd(), which returns the current working directory of the Node.js process.
View ArticleNode: How to get the dirname where a script was called from?
Say I run a Node script from /foo/bar, though the script itself is located somewhere else (e.g. node_modules). Is there a way to get the working directory where the script was called from, i.e. /foo/bar?
View Article
More Pages to Explore .....