typenv
Typenv intends to provide .env configuration with type safety in mind.
Installation
Using yarn
yarn add typenv
Using npm
npm i typenv
Usage
Quick Start
.env
DB_HOST=192.168.1.1
DB_PORT=1234
src/database_config.ts
; ;// or; console.logconfig.hostname;// > "192.168.1.1"console.logconfig.port;// > 1234
Configuration
Environment variables
DOTENV_CONFIG_PATH
- Location of.env
file (defaults to$CWD
)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.