GitXplorerGitXplorer
S

dotenv-filter-cli

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
e61c316e9fbb237dbfeefa20f9b4abbbc703f9ca

0.1.1

SSpaceK33z committed 7 years ago
Unverified
a45db8a13d8aec30ebc0421740ab0b2db52204d0

Uncomment error handling

SSpaceK33z committed 7 years ago
Unverified
0090ca29cd50cdfd8b243268d3ed186d79a437fc

Run tests before versioning

SSpaceK33z committed 7 years ago
Unverified
282a763373e06de63f2d51e55239c3af1e12fd87

0.1.0

SSpaceK33z committed 7 years ago
Unverified
e334daf211eb73020bd9f83657be42d21b423b54

add package-lock

SSpaceK33z committed 7 years ago
Unverified
302131fb4ec73a1eb2b014e4ea8c7ec73302cc1b

reduce amount of files on npm

SSpaceK33z committed 7 years ago

README

The README file for this repository.

dotenv-filter-cli

This is a very small CLI tool to filter environment variables from process.env.

You can kinda see this as the reverse of dotenv; it processes all your current env variables, allows you to filter on them and outputs it as if it were a dotenv file.

My specific use case is that when I run Zeit Now in a CI tool like Travis, I want to give it only the environment variables that start with BACKEND_, like BACKEND_SECRET. The only alternative I saw is to pass every environment variable with, -e BACKEND_SECRET etc. That is not maintainable when you have 10+ variables.

Install with npm i -g dotenv-filter-cli

Usages

$ dotenv-filter --prefix=BACKEND_
BACKEND_SECRET="xxx"
BACKEND_APP_URL="https://example.com"

Or save to a file directly:

$ dotenv-filter --prefix=BACKEND_ > .env

Or if your naming scheme uses consistent suffixes instead of prefixes:

$ dotenv-filter --suffix=_APP
SECRET_APP="xxx"

Or maybe you want to filter on multiple suffixes:

$ dotenv-filter --suffix=_APP --suffix=MAIL
SECRET_APP="xxx"
FROM_MAIL="kees@example.com"

Example usage with Zeit Now (note: this is not specific in any way to Zeit):

$ dotenv-filter --prefix=BACKEND > .env.now
$ now --dotenv .env.now