dotenv-expand

Variable expansion for dotenv. Expand variables already on your machine for use in your .env file. (by motdotla)

Dotenv-expand Alternatives

Similar projects and alternatives to dotenv-expand

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better dotenv-expand alternative or higher similarity.

dotenv-expand reviews and mentions

Posts with mentions or reviews of dotenv-expand. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-12.
  • Node.js 20.6 adds built-in support for .env files
    3 projects | dev.to | 12 Apr 2024
    Node does not support variable expansion currently. It will output the variable as a string if trying to reference another variable using $variable. This is possible in dotenv using the dotenv-expand library.
  • React .env Issues
    3 projects | /r/react | 20 Jul 2021
    If all of the above do not work, install dotenv and also dotenv-expand and run them at your src/index.js before ReactDOM.render() .
  • My favorite way to manage config file (javascript example)
    4 projects | dev.to | 10 May 2021
    // environments.js // Inspiration from https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/env.js const fs = require('fs') const path = require('path') const dotenv = require('dotenv') const dotenvExpand = require('dotenv-expand') if (!process.env.NODE_ENV) { process.env.NODE_ENV = 'development' } function getEnvPath() { return path.resolve(__dirname, '../', '.env') } function getNodeEnv() { return process.env.NODE_ENV.trim() } // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use const dotenvFiles = [ `${getEnvPath()}.${getNodeEnv()}.local`, // Don't include `.env.local` for `test` environment // since normally you expect tests to produce the same // results for everyone getNodeEnv() !== 'test' && `${getEnvPath()}.local`, `${getEnvPath()}.${getNodeEnv()}`, getEnvPath(), ].filter(Boolean) // Load environment variables from .env* files. Suppress warnings using silent // if this file is missing. dotenv will never modify any environment variables // that have already been set. Variable expansion is supported in .env files. // https://github.com/motdotla/dotenv // https://github.com/motdotla/dotenv-expand dotenvFiles.forEach(dotenvFile => { if (fs.existsSync(dotenvFile)) { dotenvExpand( dotenv.config({ path: dotenvFile, }) ) } })
  • A note from our sponsor - SurveyJS
    surveyjs.io | 6 May 2024
    With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js. Learn more →

Stats

Basic dotenv-expand repo stats
3
897
8.8
2 months ago

motdotla/dotenv-expand is an open source project licensed under BSD 2-clause "Simplified" License which is an OSI approved license.

The primary programming language of dotenv-expand is JavaScript.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com