log(process.env)' | grep npm" } } Next, run npm run check-env in your telegram philippines girl command line to see a list of all the environment variables it npm has set for you. Here's what caught my eye: You can find each entry in your package.json file as an environment variable. Accessing it is similar to accessing a property in JSON, except that it uses <p> _ as a separator. For example, <p> npm_package_dependencies_twilio gives you the version of twilio installed , or npm_package_author_email <p> gives you the email field of the property author. To access values in an array, use the index value preceded by the <p> prefix _, just like npm_package_keywords_0 you would for retrieving the first keyword.

You can get the npm version , node version , and operating system via npm_config_user_agent . The format is of type , where means macOS and is the processor architecture.npm/6.10.0 node/v10.19.0 darwin x64darwinx64 You can get the git hash of HEAD via npm_package_gitHead . There are many useful variables here and I encourage you to explore them, especially if you are working on creating automation scripts. Check out my article if you want to know more about environment variables in Node.js in general . Transmission and analysis of arguments So far, we've covered how to create scripts, what environment variables are set, and how to call scripts.