dotenv-prompter

0.9.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i dotenv-prompter

Weekly Downloads

2

Version

0.9.1

License

MIT

Last publish

Collaborators

  • stockulus