Skip to content

Standalone usage #443

@pedrolcn

Description

@pedrolcn

Issue type:

  • 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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions