@fleek-platform/env-guards
v1.10.0
Published
This package is solving not direct usage of `process.env`. Instead create in `src` of your package where you need secrets file `secrets.ts` and use it like this:
Downloads
62
Keywords
Readme
EnvGuards
This package is solving not direct usage of process.env
. Instead create in src
of your package where you need secrets file secrets.ts
and use it like this:
import { parseEnvs } from '@fleek-platform/env-guards';
export const envGuards = parseEnvs([
'HERE_LIST', //
'THE_ENV_VARIABLES',
'YOU_WANT_TO_USE',
]);
and then everywhere in your package you can use it like this:
import { envGuards } from './envGuards';
console.log(envGuards.HERE_LIST);
Add support of new ENV name
The list of strings (name of envs) that you can pass to parseEnvs
function is limited. If you want to extend it and add new env name, feel free to add it in this file: /packages/env-guards/src/lib/availableEnvKeys.ts
and build the package before usage.