Giter Site home page Giter Site logo

suryatmodulus / envful Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arvindell/envful

0.0 1.0 0.0 252 KB

A tool to verify the presence of environment variables before running a process ๐ŸŒณ

License: MIT License

Rust 91.41% JavaScript 8.59%

envful's Introduction

Envful

GitHub Workflow Status npm Crates.io

Envful is a CLI tool that verifies the presence of environment variables. It looks inside your .env file and the host system. You can use it to run any process while ensuring all the variables are set.

Never again waste time debugging your app because of a misconfigured environment.

Screen Shot 2022-01-23 at 10 13 06 p m

Installation

NPM

You can install Envful using NPM.

# Install locally
npm install envful

# Or globally
npm install -g envful

crates.io

You can also install directly from crates.io using cargo.

cargo install envful

Usage

Envful uses the .env.example file as a manifest for which variables are needed. If your project has a .env.example it already supports envful! ๐Ÿš€

Check for variables and undeclared variables using check:

envful check

You can also specify a command to run if check is successful using the '--' separator. It will immediately fail if a variable is missing, showing a helpful message.

envful -- echo "I am envful!"

This becomes very useful to check the environment inside package.json scripts:

"scripts": {
    "dev": "envful -- next",
    "build": "envful -- next build"
}

Arguments

USAGE:
    envful [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -d, --dir <DIR>    Directory to look for .env and .env.example files. Defaults to current directory.
    -h, --help         Print help information
    -V, --version      Print version information

SUBCOMMANDS:
    check    Check if env has all required variables and warns if missing
    help     Print this message or the help of the given subcommand(s)

How to declare variables

Inside your .env.example file, you can declare the variables that your application requires. You can use the triple hash market (###) to add a description to the variable. Add [optional] to a variable for warning instead of failing.

Example:

### The URL to the database instance
DATABASE_URL=

### The app secret used to sign JSON Web Tokens
APP_SECRET=

### Google Analytics ID [optional]
GA_ID=

Contributions welcome

This project welcomes contributions of any kind, whether you want to add new features, improve the documentation or just want to give some feedback.

License

Envful is published under the MIT license. See the LICENSE file for more information.

envful's People

Contributors

arvindell avatar robvilchis avatar

Watchers

 avatar

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.