0

Currently I use two global variables (__filename, __dirname) of node.js. Now in my code I need to get the name of the project. Is it possible to get via node.js global variable? Note: I can't directly import package.json as this is a browser application with webpack.

GOTO 0
  • 42,323
  • 22
  • 125
  • 158
ThatsMe
  • 123
  • 4
  • 24
  • You can import `package.json` just fine – Webpack will bundle it. – AKX Apr 04 '22 at 09:28
  • I don't think there's a global variable but maybe [this](https://stackoverflow.com/questions/10265798/determine-project-root-from-a-running-node-js-application) will help you – Nik Apr 04 '22 at 09:33

0 Answers0