Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itslukej/typed-env
💾 Typed environment variable parser.
https://github.com/itslukej/typed-env
config configuration environment-variables typescript
Last synced: 3 months ago
JSON representation
💾 Typed environment variable parser.
- Host: GitHub
- URL: https://github.com/itslukej/typed-env
- Owner: itslukej
- License: mit
- Created: 2020-02-19T11:29:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T07:29:27.000Z (almost 5 years ago)
- Last Synced: 2024-09-29T21:59:48.101Z (4 months ago)
- Topics: config, configuration, environment-variables, typescript
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typed-env
A typed environment variable parser.
```ts
import config from 'typed-env';const cfg = config({
PORT: { type: 'number', optional: true, default: 80 },
HOMEPAGE: { parser: url.parse }
})cfg.PORT // number
cfg.HOMEPAGE // URL object
```## Features
- Strongly typed
- Support for custom parsers
- Support for optional environment variables
- Support for passing in custom environments (see Options)