absxn / process-env-parser

Purpose-built utility to parse environment variables into safe runtime types in your TypeScript Node application
https://www.npmjs.com/package/@absxn/process-env-parser
17 stars 1 forks source link

Consider supporting dotfiles #5

Open teijo opened 4 years ago

teijo commented 4 years ago

Reading ".env" files is very close to what the library is doing already. The API could be expanded to parsing also these files with e.g. const result = requireEnvironmentFile(filePath: string).

dotenv package as a reference: https://github.com/motdotla/dotenv

teijo commented 4 years ago

Hmm, scratch that?

User should probably just use the env file loader and then use this library to validate the result of merged config file and environment variables. dotenv just populates process.env, which would then be read by process-env-parser.