0.9.1 • Published 7 years ago

dotenv-prompter v0.9.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bitHound Overall Score npm Package npm Package travis-ci.org js-standard-style license

dotenv-prompter

cli Prompt for .env files

Usage

npm install dotenv-prompter --save-dev

create a JSON file .env.json

{
    "PORT": {
      "description": "Port of the app",
      "message": "Port is a required integer",
      "type": "integer",
      "required": true,
      "default": 3001
    },
    "DATABASE_HOST": {
      "description": "Database host",
      "message": "Database host is required",
      "type": "string",
      "required": true,
      "default": "localhost"
    },
    "PASSWORD": {
      "description": "The password",
      "message": "The password is required",
      "type": "string",
      "replace": "*",
      "required": true,
      "hidden": true
    }
}

see also https://www.npmjs.com/package/prompt

Add to your package.json, e. g.

"scripts": {
  "postinstall": "dotenv-prompter"
}

and you get an .env file in your Project. It just asks for the missing elements

Properly exclude it via .gitignore, so every dev can have individual .env file


Twitter URL GitHub stars

0.9.1

7 years ago

0.9.0

7 years ago