Skip to content

Add dotenv dependency#1

Open
sayhiben wants to merge 2 commits into
streamwall:mainfrom
sayhiben:dotenv
Open

Add dotenv dependency#1
sayhiben wants to merge 2 commits into
streamwall:mainfrom
sayhiben:dotenv

Conversation

@sayhiben

Copy link
Copy Markdown
Contributor

The command line options are growing verbose, and it would be nice to
maintain the same settings while also not having to specify the entire
configuration in either the call to the command or by specifying them
in the environment

This commit adds a new dependency, dotenv, which allows users to copy
the provided sample.env file to ./.env and customize it themselves

Also updates .gitignore to support Jetbrains IDEs and commits the
package-lock.json to ensure dependency version consistency

sayhiben and others added 2 commits June 28, 2020 14:36
The command line options are growing verbose, and it would be nice to
maintain the same settings while also not having to specify the entire
configuration in either the call to the command or by specifying them
in the environment

This commit adds a new dependency, dotenv, which allows users to copy
the provided sample.env file to ./.env and customize it themselves

Also updates .gitignore to support Jetbrains IDEs and commits the
package-lock.json to ensure dependency version consistency
@chromakode

Copy link
Copy Markdown
Collaborator

Awesome, thanks @sayhiben! I have been feeling similarly about the proliferation of options. It's time to adopt a more scalable pattern.

FYI I have been configuring these scripts using systemd unit files, and would suggest others running these scripts in production use an equivalent service configuration / supervisor tool.

I've been thinking about switching to yargs, similar to streamwall, so that an optional config file and parameters is supported (here's how streamwall implements it). I have considered using .env files for this, but it seems like yargs provides a few advantages:

  • separate config files for multiple configurations
  • control over config parsing (I've been thinking about switching to TOML for easy writing)
  • param descriptions/--help output

yargs can also consume environment variables.

Would you be interested in taking this on?

@sayhiben

sayhiben commented Jun 28, 2020 via email

Copy link
Copy Markdown
Contributor Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants