@bahmutov/print-env
Prints all environment variables that start with given string
Install and use
Requires Node version 6 or above.
Usually on your CI, you can just install this CLI tool globally
npm install @bahmutov/print-env
Then call the tool with prefix, for example to show all Travis vars
$ print-env TRAVIS
TRAVIS_BRANCH=master
TRAVIS_SUDO=false
TRAVIS_NODE_VERSION=8
TRAVIS_PRE_CHEF_BOOTSTRAP_TIME=2017-08-29T02:16:18
...
Variables are sorted alphabetically.
has-env
You can also check if sensitive variables are present using has-env PREFIX
syntax. In that case the values are not printed, only "present: true"
$ has-env GH
GH_API_KEY is present: true
GH_INSTALLATION_ID is present: true
...
npx
You can run this tool without installing it permanently using npx
command
$ npx -p @bahmutov/print-env has-env USER
npx: installed 1 in 0.737s
USER is present: true
$ npx -p @bahmutov/print-env print-env USER
npx: installed 1 in 1.975s
USER=gleb
The CLI argument -p
is an alias to --package
and tells npx
which package to install, followed by the command alias (has-env
or print-env
) and its arguments.
Small print
Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2017
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet /
open issue on Github
MIT License
Copyright (c) 2017 Gleb Bahmutov <gleb.bahmutov@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.