I have a script that has:
global_npm_modules_path="$(npm root -g)";
this npm command is slow, and I am looking to speed up this script. One thing I could do is "cache" the result of the npm command, something like this:
export global_npm_modules_path=${global_npm_modules_path:-"$(npm root -g)"}
but my question is - how can I set global_npm_modules_path
so that it's held in store by the parent shell / parent process?
The problem is the export command will only be relevant for this shell and its children.