@olliecaine/env-vars
v1.0.3
Published
Load and validate environment variables using TypeScript and Zod
Maintainers
Readme
Env Vars
Load and validate environment variables using TypeScript and Zod
Stacks
- unit test: jest
- code coverage: jest (optional)
- ci: travis
How to use?
import { loadEnv } from '@olliecaine/env-vars'
const env = loadEnv(z.object({
API_URL: z.string().url().default('http://localhost:8080'),
}))
console.log(env.API_URL)Commands list
yarn test // run tests and coverage report
yarn test:watch // run test on watch mode (without coverage report)
yarn build // build for both esm (ES5 + ES2015 module) and ES5 UMD bundle, at dist folder.
yarn lint // run lint against lib and testTesting
This boilerplate use Jest as test framework.
Reference
http://blog.mgechev.com/2017/01/21/distributing-an-angular-library-aot-ngc-types
Please help
PRs welcome
License
MIT
