1.4.0 • Published 2 years ago

env-var-base v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

env-var-base

styled with prettier Coverage Status

Base configuration class that uses env-var and dotenv

Installation:

npm i env-var-base

Usage:

class AppConfig extends BaseConfig {
  port = this.get('PORT').default(3000).asPortNumber()
}
const config = new AppConfig()
console.log(config.port) // 3000

Env names can also be typed like this:

type Env = { PORT: string, HOST: string }

class AppConfig extends BaseConfig<keyof Env> {}

or directly:

class AppConfig extends BaseConfig<'PORT' | 'HOST'> {}

Bootstrapped with https://github.com/LuisReinoso/typescript-library-starter

1.4.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago