How to use the dotenv._setEnvs function in dotenv

To help you get started, we’ve selected a few dotenv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creynders / konfy / lib / node.js View on Github external
function doLoadEnv(opts){
    if( !process.env.NODE_ENV ){
        process.env.NODE_ENV = "development";
    dotenv._getKeysAndValuesFromEnvFilePath( opts.dotenvFile );
    dotenv._getKeysAndValuesFromEnvFilePath( opts.dotenvFile + "." + process.env.NODE_ENV );
    process.env.ENV_LOADED = process.env.NODE_ENV;
    console.log( "[Konfy] loaded env variables for '" + process.env.NODE_ENV + "'" );


Loads environment variables from .env file

Latest version published 2 months ago

Package Health Score

94 / 100
Full package analysis