https://github.com/rubiin/sample-env
Generate sample file from .env for your apps
https://github.com/rubiin/sample-env
cli env environment nodejs
Last synced: 8 months ago
JSON representation
Generate sample file from .env for your apps
- Host: GitHub
- URL: https://github.com/rubiin/sample-env
- Owner: rubiin
- Created: 2022-08-28T07:06:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-10T02:45:09.000Z (over 1 year ago)
- Last Synced: 2025-03-10T03:44:34.005Z (over 1 year ago)
- Topics: cli, env, environment, nodejs
- Language: TypeScript
- Homepage:
- Size: 986 KB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# sample-env
## About
Effortlessly create sample environment files tailored to your projects with ease. This cli streamlines the process by effortlessly generating environment files, ensuring all sensitive information is excluded saving you the hassle of manually scrubbing secrets.
## How to install
- Install
```sh
npm i sample-env -g
```
## Usage
```sh
sample-env --env .env --sample .env.example --banner "hello world" --removeComments --prefix REACT_APP_
```
This command will:
- take `.env` file
- parse its keys and values
- create banner text at the top of the file
- only include keys that start with `REACT_APP_`
- remove all comments
- dump all the keys and values into the `.env.example` file
## Supported arguments and commands
The cli takes these optional flags.
* --env (default `.env`) - use this option if you want to use a different file name
* `--env .env.dev`
* --sample (default `.env.sample`) - use this option if you want to use a output file name
* `--sample .env.example`
* --banner - use this option if you want to add a custom banner text at start of file
* `--banner "hello world"`
* --removeComments - use this option if you don't want to include comments in the file
* `--removeComments`
* --prefix - use this option if you want to include only keys that start with a certain prefix
* `--prefix REACT_APP_` or `--prefix REACT_APP_ --prefix GATSBY_`
## Help Usage
```sh
sample-env --help
```