Skip to content

Instantly share code, notes, and snippets.

@emmiep
Created June 11, 2018 16:10
Show Gist options
  • Save emmiep/aad0cdd809bc91947dad5e3c0f745508 to your computer and use it in GitHub Desktop.
Save emmiep/aad0cdd809bc91947dad5e3c0f745508 to your computer and use it in GitHub Desktop.
Some of the environment variables set by yarn when running a script
npm_config_version_git_tag
npm_config_email
npm_config_init_license
npm_config_registry
npm_config_python
npm_package_description
npm_package_license
npm_execpath
npm_config_argv
npm_lifecycle_event
npm_package_name
npm_config_version_commit_hooks
npm_config_username
npm_config_bin_links
npm_package_main
npm_package_version
npm_package_scripts_test
npm_config_strict_ssl
npm_config_save_prefix
npm_config_version_git_message
npm_lifecycle_script
npm_config_user_agent
npm_config_ignore_scripts
npm_config_version_git_sign
npm_config_ignore_optional
npm_config_init_version
npm_config_version_tag_prefix
npm_package_scripts_env
npm_node_execpath
@emmiep
Copy link
Author

emmiep commented Jun 11, 2018

Using a npm script with the command env | awk -F= '/^npm_/ { print $1 }' and run using yarn run -s env.
I always forget npm_node_execpath etc but it's hard to find any documentation.

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