https://github.com/joaofaveri/env-example-generator
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
https://github.com/joaofaveri/env-example-generator
Last synced: 10 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/joaofaveri/env-example-generator
- Owner: joaofaveri
- Created: 2025-03-13T19:47:51.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-13T20:40:32.000Z (10 months ago)
- Last Synced: 2025-03-13T21:24:34.740Z (10 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# EnvExampleGenerator
[](https://badge.fury.io/js/env-example-generator)
[](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
```bash
npx env-example-generator -i .env -o .env.example -t
```
## Use interactive mode
```bash
npx env-example-generator -I
```
## Include comments and use a custom delimiter
```bash
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