Skip to content

Instantly share code, notes, and snippets.

@brian-mcallister-lab49
Created June 8, 2020 20:38
Show Gist options
  • Save brian-mcallister-lab49/4ce73359256c1610fc2a2cf67809ea25 to your computer and use it in GitHub Desktop.
Save brian-mcallister-lab49/4ce73359256c1610fc2a2cf67809ea25 to your computer and use it in GitHub Desktop.
TIL-Lab49/There are all kinds of useful environment variables set by npm.

npm will set all kinds of useful environment variables for you. To see what gets set, add the following to your package.json:

{
  "scripts": {
    "check-env": "node -e 'console.log(process.env)' | grep npm"
  }
}

...and then run $ npm run check-env.

Lots of information about your dependencies, configuration, node and npm versions, and, interestingly npm_package_gitHead, which is the SHA of the current git HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment