Add dotenv dependency#1
Open
sayhiben wants to merge 2 commits into
Open
Conversation
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
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
Would you be interested in taking this on? |
Contributor
Author
|
I agree - yargs is likely the right solution. I'm actually in the middle of
solving a different challenge with this repo (evaluating live status of
profiles instead of discrete videos). This was a quick and dirty
implementation meant to provide a stepping stone; if you'd rather move to
yargs, I fully support it.
If I'm honest, I don't have bandwidth to handle anything outside of my
critical path right now, although normally I'd take you up on the offer to
implement. I'm happy to keep this in my fork for the time being if that's
preferable to taking on the debt of refactoring it later
…On Sun, Jun 28, 2020 at 3:22 PM Max Goodhart ***@***.***> wrote:
Awesome, thanks @sayhiben <https://github.com/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
<https://www.npmjs.com/package/yargs>, similar to streamwall
<https://github.com/chromakode/streamwall>, so that an optional config
file and parameters is supported (here's how streamwall implements it
<https://github.com/chromakode/streamwall/blob/1087c6855e3e6546d0260d9c260baf71caeebc9c/src/node/index.js#L13-L15>).
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
<https://yargs.js.org/docs/#api-envprefix>.
Would you be interested in taking this on?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFFX2SAM2RFMDPGW2XC4BLRY67BRANCNFSM4OKW4TJA>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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