src/envalid.js
function extendWithDotEnv(inputEnv, dotEnvPath = '.env') {
    let dotEnvBuffer = null
    try {
        dotEnvBuffer = fs.readFileSync(dotEnvPath)
    } catch (err) {
        if (err.code === 'ENOENT') return inputEnv
        throw err
    }
    const parsed = dotenv.parse(dotEnvBuffer)
    return extend(parsed, inputEnv)
}
function extendWithDotEnv(inputEnv, dotEnvPath = '.env') {
    let dotEnvBuffer = null
    try {
        dotEnvBuffer = fs.readFileSync(dotEnvPath)
    } catch (err) {
        if (err.code === 'ENOENT') return inputEnv
        throw err
    }
    const parsed = dotenv.parse(dotEnvBuffer)
    return extend(parsed, inputEnv)
}
function extendWithDotEnv ( inputEnv , dotEnvPath = '.env' ) { let dotEnvBuffer = null try { dotEnvBuffer = fs . readFileSync ( dotEnvPath ) } catch ( err ) { if ( err . code === 'ENOENT' ) return inputEnv throw err } const parsed = dotenv . parse ( dotEnvBuffer ) return extend ( parsed , inputEnv ) }
Extend an env var object with the values parsed from a ".env" file, whose path is given by the second argument.
Extend an env var object with the values parsed from a . env file whose path is given by the second argument .