1.1.5 β€’ Published 2 years ago

dotenv-checker v1.1.5

Weekly downloads
24
License
ISC
Repository
github
Last release
2 years ago

πŸ”Œ dotENV-checker standard-readme compliant

Environment file checker/generator

πŸ”– Description

This application is a checker/generator for environment files. It checks, based on a schema/base file, if your .env is up-to-date and it maintains them synchronized.

πŸ“¦ Installation

# Install the cli in devDependencies
$ npm i dotenv-checker -D

πŸš€ Usage

Automatically, when you installs the package it will add a "predev" script. In case you need it, here you have an example to make it manually

{
  "scripts": {
    // Script with "pre" in the name is executed before
    // the script named "dev" automatically
    "predev": "dotenv-checker -s .env.schema -e .env.local",
    "dev": "next dev"
  }
}

πŸ› οΈ CLI Options

You can customize the cli options. Here you have the possible customizations:

🟣 --schema or -s (default: ".env.schema")

Sets the custom file to be used as a schema/base file. This is the file which is used to sync the environment file

# Set a custom schema (file to be based on)
dotenv-checker --schema .env.base

🟣 --env or -e (default: ".env.local")

Sets the custom file to be synchronized with the schema file. In case this file is out-of-sync and has some keys that the schema doesn't have, it reports the named keys to you through terminal

# File to check that needs to be in sync with schema file
dotenv-checker --env .env.local

🟣 --skip-create-question or -scq (default: "true")

By default it auto create the environment file if it doesn't exist. If you set this to "false" you can force to be asked to create it or not in case it's needed

# File to check that needs to be in sync with schema file
dotenv-checker --skip-create-question=false

🟣 --skip-update-question or -suq (default: "true")

By default it auto updates the environment file if it differs from schema file. If you set this to "false" you can force to be asked to update it or not in case it's needed

# File to check that needs to be in sync with schema file
dotenv-checker --skip-create-question=false

πŸ’» Examples

Files are in sync and no problems were found

Schema has new keys and env file is not synchronized

Environment file has keys that are not in schema


πŸ€“ Happy Code

Created with Typescript! ⚑ and latin music 🎺🎡

This README.md file has been written keeping in mind

1.1.1

2 years ago

1.1.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.0.4

2 years ago

1.1.2

2 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago