0

How would you detect the root path of the project that installed your npm package? I'm working on an NPM package that needs to do stuff in the root directory of the consumer project.

It is worth mentioning that I'm writing code in ES modules syntax so previous solutions that relied on require.main.filename are no longer working...

  • Does this answer your question? https://stackoverflow.com/questions/10265798/determine-project-root-from-a-running-node-js-application – savageGoat Feb 16 '22 at 12:50

0 Answers0