@selfage/env_var_getter
Version:
Get optional/required variable from process.env.
10 lines (5 loc) • 593 B
Markdown
`npm install @selfage/env_var_getter`
Written in TypeScript and compiled to ES6 with inline source map & source. See [@selfage/tsconfig ](https://www.npmjs.com/package/@selfage/tsconfig) for full compiler options. Provides a type-safe way to get environment variables from `process.env`. And another important feautre is that you can only get a variable once, to make sure there is no conflicted/duplicated definition of a variable. Therefore, one should get a variable as early as possible and save it in a global variable for future use.