Skip to content

promethee/merge.env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

merge.env

A simple way to merge different .env files

Install :

  npm install merge.env

or

  yarn add merge.env

The arguments to provide

  const args = {
    required, // the .env.sample file with keys requirements 
    defaults, //  the .env.default file with default values
    current, //  the content of the current .env file
  };

  // Async version, a classic promise using resove / reject
  mergeEnv(args)
    .then(console.info)
    .catch(console.warn);

  // Async alternative version, always resolve to [error, result]
  // error can either be null or instance of Error
  // result can either be undefined or an object...
  // ...you can check for error instead of checking result 
  const [error, mergedEnv] = await mergeEnv(args);

or

  const [error, mergedEnv] = mergeEnvSync(args); // Sync version

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published