GithubHelp home page GithubHelp logo

wreckah / dotenv-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chempogonzalez/dotenv-checker

0.0 0.0 0.0 1.03 MB

πŸ”Œ CLI to check/generate .env files and maintain them synchronized

JavaScript 100.00%

dotenv-checker's Introduction

πŸ”Œ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.