@axah/env-utils
v3.0.0
Published
Environment nodeJS utils for microservices at AXA Healthcare switzerland.
Downloads
13,463
Maintainers
Keywords
Readme
@axah/env-utils
Environment nodeJS utils for microservices at AXA Healthcare switzerland.
Installing a release
Install @axah/env-utils
using the following command:
yarn add @axah/env-utils
Usage
Here some examples.
import { parseBooleanFromEnv, parseDateFromEnv, parseStringFromEnv, parseIntegerFromEnv, parseFloatFromEnv } from '@axah/env-utils/lib/main';
export default {
logLevel: parseStringFromEnv('LOG_LEVEL', 'debug'),
enableQG: parseBooleanFromEnv('ENABLE_QG', true),
sendContractDate: parseDateFromEnv('SEND_CONTRACT_DATE', new Date(Date.UTC(2020,0,1))),
maxRetries: parseIntegerFromEnv('MAX_RETRIES', 5),
confidenceLevelThreshold: parseIntegerFromEnv('CONFIDENCE_LEVEL_THRESHOLD', 0.95),
clientCertificate: {
pfxFilePath: parseStringFromEnv('CP_CERT_FILE', ''),
passphraseFilePath: parseStringFromEnv('CP_CERT_PASSPHRASE_FILE', ''),
},
};