Meteor tip of the day: Meteor environment variables

Submitted by Frederic Marand on

Use the source, LukeThere are a lot of environment variables in any Meteor version. You probably know MONGO_URL and ROOT_URL, but how many others are there ? Do the Meteor guide and the Meteor docs reveal them all ? Guess no longer: just ask the source.

To find them all, all it takes is this one-liner:

grep -roP "process\.env\.([\w]+)" ~/.meteor/ | sed 's/.*:process\.env\.//' | sort | uniq | pr -3Tw140

Just for fun, here are the results on a fresh Meteor 1.3.2.4 deployment.

_     METEOR_OPLOG_TOO_FAR_BEHIND npm_config_tmp
APPDATA     METEOR_PACKAGE_SERVER_URL npm_config__underbar_env_thing
APP_ID     METEOR_PACKAGE_STATS_SERVER_URL NPM_CONFIG_UPPERCASE_ENV_THING
APP_MONGO     METEOR_PACKAGE_STATS_TEST_OUTPUT npm_config_userconfig
AUTOUPDATE_VERSION     METEOR_PARENT_PID npm_config_x
BABEL_CACHE_DIR     METEOR_PKG_SPIDERABLE_PHANTOMJS_ARGS npm_config_yes
BABEL_CACHE_PATH     METEOR_PRETTY_OUTPUT npm_execpath
BABEL_DISABLE_CACHE     METEOR_PRINT_ON_LISTEN npm_lifecycle_script
BABEL_ENV     METEOR_PROGRESS_DEBUG npm_package_config_port
BIND_IP     METEOR_SAVE_TMPDIRS npm_package_name
BLUEBIRD_DEBUG     METEOR_SESSION_FILE npm_package_run_script_foo_var
CAFILE     METEOR_SETTINGS npm_package_scripts_install
CMD     METEOR_SHELL_DIR npm_run_script_foo_var
COMP_CWORD     METEOR_SKIP_NPM_REBUILD NVM_IOJS_ORG_MIRROR
COMP_LINE     METEOR_TEST_FAIL_RELEASE_DOWNLOAD NVM_NODEJS_ORG_MIRROR
COMP_POINT     METEOR_TEST_FAKE_MONGOD_CONTROL_PORT OBJECT_IMPL
COMPUTERNAME     METEOR_TEST_LATEST_RELEASE OSTYPE
comspec     METEOR_TEST_MULTIPLE_MONGOD_REPLSET PACKAGE_DIRS
ComSpec     METEOR_TEST_NO_PUBLISH path
CORDOVA_PLUGIN_ID     METEOR_TEST_PRINT_LINKER_CACHE_DEBUG Path
DDP_DEFAULT_CONNECTION_URL     METEOR_TEST_TMP PATH
DEBUG     METEOR_TOOL_PATH PATHEXT
DEBUG_COLORS     METEOR_WAREHOUSE_DIR PHANTOMJS_CDNURL
DEBUG_FD     METEOR_WATCH_FORCE_POLLING PORT
DEBUG_MIME     METEOR_WATCH_POLLING_INTERVAL_MS PREFIX
DEBUG_NOPT     MOBILE_DDP_URL PROMPT
DEPLOY_DOMAIN     MOBILE_ROOT_URL PS1
DEPLOY_HOSTNAME     MONGO_OPLOG_URL PUMMEL
DESTDIR     MONGO_URL PWD
DISABLE_WEBSOCKETS     MSYSTEM PYTHON
DISCOVERY_PORT     MW Q_DEBUG
EDITOR     NODE_BINDINGS_ARROW random_env_var
EMACS     NODE_BINDINGS_COMPILED_DIR ROOT_URL
EXPRESS_COV     NODE_DEBUG RUN_ONCE_OUTCOME
FAST     NODE_DISABLE_COLORS run_script_foo_var
GALAXY_MOCK_MODE     NODE_ENV SAUCE_KEY
GALAXY_PASSWORD     NODEJS_ORG_MIRROR SAUCE_PROJ
GALAXY_USERNAME     NODE_NDEBUG SAUCE_USER
HOME     NODE_OPTIONS SERVER_WEBSOCKET_COMPRESSION
HOSTNAME     NODE_PATH SHELL
http_proxy     NODE_PATHS STYLUS_COV
HTTP_PROXY     NO_DEPRECATION SUDO_GID
https_proxy     NODE_TLS_REJECT_UNAUTHORIZED SUDO_UID
HTTPS_PROXY     NO_METEOR_PACKAGE SystemDrive
IOJS_ORG_MIRROR     no_proxy SystemRoot
JOBS     NO_PROXY TEMP
LANG     NOPT_DEBUG TERM
LC_ALL     npm_config_ TEST_COV
LC_CTYPE     npm_config_argv TEST_GRACEFUL_FS_GLOBAL_PATCH
MAIL_URL     npm_config__auth TEST_METADATA
MAKE     npm_config__authCrypt TEST_PSEUDOMAP
METEOR_APP_PRELINK_CACHE_SIZE     npm_config_cache TEST_REGEN
METEOR_BAD_PARENT_PID_FOR_TEST     npm_config_depth THROW_FROM_PACKAGE
METEOR_BUILD_FARM_URL     npm_config_global TIMEOUT_SCALE_FACTOR
METEOR_CATALOG_COMPRESS_RPCS     npm_config_globalconfig TIMES
METEOR_COLOR     npm_config_init_author_email TINYTEST_FILTER
METEOR_DEBUG_BUILD     npm_config_init_author_name TMP
METEOR_DEBUG_SPRINGBOARD     npm_config_init_author_url TMPDIR
METEOR_DEBUG_SQL     npm_config_init_license TRACE_DEPRECATION
METEOR_DISABLE_BUILDER_IN_PLACE     npm_config_init_version TRAVIS
METEOR_FORCE_PORTABLE     npm_config_loglevel TRAVIS_BRANCH
METEOR_INSTALLATION     npm_config_node_version TRAVIS_BUILD_NUMBER
METEOR_LINKER_CACHE_SIZE     npm_config_other_env_thing TRAVIS_JOB_ID
METEOR_LOG     npm_config__password TRAVIS_JOB_NUMBER
METEOR_NO_WORDWRAP     npm_config_prefix TRAVIS_NODE_VERSION
METEOR_OFFLINE_CATALOG     npm_config_proxy TRAVIS_PULL_REQUEST
TREE_HASH_DEBUG     USERDOMAIN windir
UNLAZY     USERNAME WRITE_RUNNER_JS
USE_JSESSIONID     USERPROFILE YOUR_APP_ENV

Seriously ?