0.7.3 • Published 2 years ago

@collection-nest/environment v0.7.3

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

@nest-collection/environment

Wrapper around @nestjs/config so that we can have more control over environment variables and project configuration in general.

Install

yarn add @collection-nest/environment

Example

const nodeEnvToPath = {
  production: '.env.production',
  development: '.env.development',
}

const NODE_ENV = process.env.NODE_ENV as keyof typeof nodeEnvToPath

// Optional
const validationSchema = Joi.object({
  NODE_ENV: Joi.string().valid('development', 'production').required(),
  PORT: Joi.number().default(3000),
})

const envFilePath = nodeEnvToPath[NODE_ENV]

EnvironmentModule.register({
  envFilePath,
  validationSchema,
})
0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.5.3

2 years ago

0.7.3

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.7.0

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago