I want to write code that will be executed by npm postinstall only if the package is installed globally. Is there an integrated detection solution if the active package is installed globally?
If not, what is the best workaround that will work on any OS? My only idea at this time is to check the current working directory of the package and see if it is under the npm global route.
source
share