inxilpro / node-checkenv

Check your current environmental variables against a project config file
46 stars 6 forks source link

Idea: Warning when env var is empty #4

Closed timwis closed 8 years ago

timwis commented 8 years ago

This may be a total bad idea, but when I use .env files, I provide a .env.sample with empty env vars, ie:

HOST=
PORT=
PATH=

And my readme tells folks to copy the file to .env and fill them in. If they copy/rename it but don't fill them in, they won't get a warning. I can see how this might contradict a circumstance when you intentionally want a var blank.

Maybe this fits into your validation ideas? ie. "not allowed to be empty"

inxilpro commented 8 years ago

Yeah, I think this is better handled by validation. You can take a look at the next branch to get a sneak peek. I'm basically allowing for all of validator.js in the config, so you should be able to have pretty fine-grained control.

inxilpro commented 8 years ago

Alright, take a look now. Tons of validation options :)

timwis commented 8 years ago

Nice! Sounds like a productive weekend :) I guess I'd use the length.min validator