Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.
/ dotenv-setup Public archive

The .env generator you can bundle with your project

Notifications You must be signed in to change notification settings

devicarus/dotenv-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to dotenv-setup 👋

Version

The .env generator you can bundle with your project

Not having the .env in git makes your life easier, but it may be confusing for new users. This package solves it. You define the variables and the user just runs a script which asks him what to fill in and then generates the .env file. Easy.

Usage

1. Add dotenv-setup to your dependencies

yarn add dotenv-setup
# OR
npm install dotenv-setup

Q: Why not CLI?
A: You can bundle it with your boilerplate this way!

2. Create your dotenv-setup configuration file (e.g. setup.js)

// setup.js contents
require('dotenv-setup')([
    {
        name: "VARIABLE_ONE",
        message: "Description for the VARIABLE_ONE",
        type: Boolean
    }, 
    {
        name: "VARIABLE_TWO",
        message: "Description for the VARIABLE_TWO",
        type: Number
    },
    {
        name: "VARIABLE_THREE",
        message: "Description for the VARIABLE_THREE",
        type: String
    }
])

3. Done! You can now use your generator!

node setup.js

Tip: You may also add it to your npm scripts!

Author

👤 DEVICARUS