An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# EnvExampleGenerator

[![npm version](https://badge.fury.io/js/env-example-generator.svg)](https://badge.fury.io/js/env-example-generator)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](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