Giter Site home page Giter Site logo

Comments (3)

fenos avatar fenos commented on August 16, 2024 2

Hi @andrew-yustyk

Thanks for the suggestion.

You are welcome to make a PR if you can.

I'd be happy to have this functionality optional driven by a safe flag upon initialisation of the ConfigModule something like: ConfigModule.load({safe: true})

By default, I would keep it false.

From the documentation of dotenv-safe looks, that we can use the flag allowEmptyValues to turn on or off the guard.

https://www.npmjs.com/package/dotenv-safe#options

from nestjs-config.

andrew-yustyk avatar andrew-yustyk commented on August 16, 2024 2

I'll try to make a PR in the near time

from nestjs-config.

andrew-yustyk avatar andrew-yustyk commented on August 16, 2024

I'm agree with you, that safe option should be optional and disabled bu default.

As for the allowEmptyValues from dotenv-safe, it was creating for the another purposes as far as I understand. Whet allowEmptyValues option is true, dotenv-save allows to define env vars with empty values:

MY_VARIABLE=

but variable still needs to be present even with empty value. In a case when required variable doesn't exist in process.env, an error still will be thrown.

I think will be better to add additional options for dotenv-safe to the ConfigModule.load() method

from nestjs-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.