Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dotenv dependency #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add dotenv dependency #1

wants to merge 2 commits into from

Conversation

sayhiben
Copy link
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
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
Copy link
Contributor Author

sayhiben commented Jun 28, 2020 via email

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