nestjs-config icon indicating copy to clipboard operation
nestjs-config copied to clipboard

Standalone usage

Open pedrolcn opened this issue 3 years ago • 0 comments

Issue type:

  • [x] question
  • [ ] bug report
  • [ ] feature request
  • [ ] documentation issue

nestjs-config version 1.0.1

@nestjs/common+core or other package versions

  • @nestjs/common: 7.6.15
  • @nestjs/core: 4.5.7

Is is possible to use this lib in a standalone fashion ? eg: one not tied to nest.js at all.

My use case is that I am using mikro-orm (which provides a really nice integration with nest.js btw). It has a cli tool which can be configured via a .js file exporting an object containing the config object. Right now the config is mostly hard-coded, but I would like to use nestjs/config to load envs from a .env file and populate the config object to be exported from this script.

I know it is really simple to do this using dotenv, but I would really like to be able to have a single way of loading envs in my application, so is it possible to use this lib in a standalone manner as described above ?

pedrolcn avatar Aug 02 '21 22:08 pedrolcn