I have an npm package https://npmjs.com/package/@buildtip/create-web-app where the main file is running when the package is run is
dist/cli.js. Now, this file needs to get a file from one upper directory. The method I implemented in node is
But this is checking from in the folder from where the command is running or from the location of the user’s terminal. Not from where this package is installed.
This is the code for the package. link
I want a node method or something which can get me the location of the project installed (global location as it is global package) not the location from where it is called.