Skip to content

A package that generates .env.example files. It reads a .env file, and remove all the values, keeping only the keys. Allowing the user to create a template of the enviroment variables

Notifications You must be signed in to change notification settings

joaofaveri/env-example-generator

Repository files navigation

EnvExampleGenerator

npm version License

EnvExampleGenerator: Simplify Environment Variable Management. Generate .env.example files by extracting keys from your existing .env files, removing sensitive values, and ensuring consistent configurations across your team. Streamline project setup and improve onboarding with a single command.

Usage (Recommended)

You can run EnvExampleGenerator directly using npx (or the equivalent for Yarn and pnpm):

```bash npx env-example-generator [options] ``` ```bash yarn env-example-generator [options] ``` ```bash pnpm env-example-generator [options] ```

Installation (Optional)

If you prefer, you can install EnvExampleGenerator globally or locally:

```bash npm install -g env-example-generator # Global npm install env-example-generator # Local ``` ```bash yarn global add env-example-generator # Global yarn add env-example-generator # Local ``` ```bash pnpm install -g env-example-generator # Global pnpm install env-example-generator # Local ```

Options

-i, --input : Path to the input .env file. Default: .env, .env.local, .env.development, .env.production. -o, --output : Path to the output .env.example file. Default: .env.example. -t, --typescript: Generate the env.d.ts file with type definitions. -r, --remove-comments: Remove comments from the .env.example file. -I, --interactive: Interactive mode. -c, --include-comments: Include comments from the .env file in the .env.example file. -d, --delimiter : Delimiter used in the .env file. Default: =.

Examples

Generate .env.example and env.d.ts files

npx env-example-generator -i .env -o .env.example -t

Use interactive mode

npx env-example-generator -I

Include comments and use a custom delimiter

npx env-example-generator -i .env -o .env.example -c -d ':'

Contributing

Contributions are welcome! Feel free to open issues and pull requests.

License

MIT

Author

@joaofaveri João Paulo de Faveri

About

A package that generates .env.example files. It reads a .env file, and remove all the values, keeping only the keys. Allowing the user to create a template of the enviroment variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published