1.1.0 • Published 1 year ago

dotenv-comparer v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

dotenv-comparer

Tool for comparing and sync values between .env and .env.dist files

Install

npm install dotenv-comparer

Usage

const DotEnvComparer = require('dotenv-comparer');

const dotEnvComparer = new DotEnvComparer({
  envPath: './.env',
  envDistPath: './.env.dist',
});

let newVariables = dotEnvComparer.getNews();
console.log(newVariables);
//=> returns an array of new variables

let differences = dotEnvComparer.getDifferences();
console.log(differences);
//=> returns an array of differences between .env and .env.dist

let addedVariables = dotEnvComparer.addMissing();
console.log(addedVariables);
//=> returns the amount of added variables from .env.dist into .env

You can view more examples in the examples folder.