'Is it possible to get project name via global variable in node.js?

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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source