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

https://github.com/tamdilip/env-gen

Minimal node utility to scan all process.env references in a node project
https://github.com/tamdilip/env-gen

cli dotenv environment-variables nodejs npx utility

Last synced: about 2 months ago
JSON representation

Minimal node utility to scan all process.env references in a node project

Awesome Lists containing this project

README

          

# env-gen [![Node.js Package](https://github.com/tamdilip/env-gen/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/tamdilip/env-gen/actions/workflows/npm-publish.yml)

`.env` file generator by extracting all environment variables referenced in node js project through `process.env.*`

# usage
```bash
$ cd
$ npx env-gen
```

## Optional
### Silent mode
Append `--silent` to the main command `npx env-gen` to simply scan and generate `.env` file without prompting any inputs and displaying log traces.

```bash
$ npx env-gen --silent
```

### Path exclusion
Place `env-gen-config.js` under the same path from where you are executing `npx env-gen` to exclude paths from scanning in the below format.

```javascript
module.exports = {
exclude: ['/node_modules', '/coverage'] //default
};
```