Skip to content
dotenv checker and sync
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src
.gitignore
Dockerfile
README.md
env-sync.js
package-lock.json
package.json

README.md

Dot Environment Sync

Check different of 2 dotenv files and sync it

Install

npm install --save env-sync

Usage:

CLI

./node_modules/.bin/env-sync.js .env .env.default

DOCKER

docker run --rm -v $(pwd):$(pwd) kenylieou/env-sync /path/to/.env /path/to/.env.sample

example:

docker run --rm -v $(pwd):$(pwd) kenylieou/env-sync $(pwd)/.env $(pwd)/.env.default -v

CLI Options

Usage: env-sync [options] <file1> <file2>

file1: is the file need to check
file2: is the file used to compare

Options:
  -V, --version  output the version number
  -s, --sync     Sync the missing environment key and write to file1
  -v, --verbose  Display verbose
  -h, --help     output usage information

This is in .env.default

VAR1=1
VAR2=true
VAR3=false
VAR4=0
VAR5="hello world"

This is in .env

VAR1=
VAR2=1
VAR3=false

After run env-sync

VAR1=1
VAR2=1
VAR3=false
VAR4=0
VAR5="hello world"
You can’t perform that action at this time.