akileez/test-npinit

consider reading a configuration file from outside the program

Opened this issue · 9 comments

gives another option and opens the door for automation

think i will use yaml and/or js for outside config files
yaml ensures another large dependency...but for dumping object data, another story.

this will make using a cache a certainty.

will need to sketch out how this would work.

for instance, I could bypass the init process (in conf_v2) entirely which would speed up the process of obtaining user data. a command line option would satisfy here, such that if called, the program would read a user provided config, set the internal config cache and run next step of the process. Slowdown of reading in data not taken into account.

further thought..the reading of the user config could occur during init just after the setting of options and before the global config gets set.

commit 9047a90 addresses this issue. decided to require a .js file. A javascript file allows the the easy creation of three objects, separately exported which facilitates the importing of data.

initial scaffolding works like a charm.
time is also significantly faster than using npm config command mentioned in #6

npconf-user_provided_file_output

this process by-passes init:configuration settings and does not sanitize the input. therefore command line options become irrelevant and unknown input errors could/will pop up.

running a user config file from update f5f7194
and I happened to delete my /tmp directory in the process of building this update. lost 6 months worth of research!!!

npi js — devtoolz 2021-05-07 09-10-24

results:

npi js — devtoolz 2021-05-07 09-10-50

compare to above: running build without a user provided config

npi js — devtoolz 2021-05-07 09-11-14

results:

npi js — devtoolz 2021-05-07 09-11-37