Conversation
|
Looks interesting. Can you go over some use cases? How is this better than using default arguments? |
|
I load a config using the rc module, (this allows me to have a separate config for each project, yet one "base" config in the directory below the project that all the configs are derived from. I can use default for each option, however, if one of the options is't defined in the config it will give an error because undefined is converted to a string. so, instead of checking undefined for every option, an initial option gave me the results I was looking for. additionally, I plan to use this parser in a REPL I'm working on, and rebuilding the options array for each command (command's defaults depend on the directory in which you run it), it would make that a lot easier as well :) |
this adds initial values to the parse function.
I additionally added a whole bunch of tests and also nearly committed some tabs too, and realized you didn't have an editorconf
cool lib bro!