# env-scripts

> A collection of scripts to perform actions related to .env files.

Latest version **1.1.0** (published 2023-03-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install env-scripts
pnpm add env-scripts
yarn add env-scripts
bun add env-scripts
```

Provides the command `env-scripts`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-03-17 |
| First published | 2022-08-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | e-e |
| Keywords | .env, .env file, .env file diff, .env files, find missing .env variables, sort .env file |

## Links

- npm: https://www.npmjs.com/package/env-scripts
- Repository: https://github.com/e-e/env-scripts
- Homepage: https://github.com/e-e/env-scripts#readme
- Issues: https://github.com/e-e/env-scripts/issues
- npm.io page: https://npm.io/package/env-scripts

## Dependencies (3)

- [dotenv](https://npm.io/package/dotenv.md) ^16.0.1
- [commander](https://npm.io/package/commander.md) *
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.2.1

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2023-03-17
- 1.0.6 — 2023-03-17
- 1.0.5 — 2022-09-28
- 1.0.4 — 2022-08-28
- 1.0.3 — 2022-08-28
- 1.0.2 — 2022-08-28
- 1.0.1 — 2022-08-27
- 1.0.0 — 2022-08-27
- 0.0.6 — 2022-08-27
- 0.0.5 — 2022-08-27
- 0.0.4 — 2022-08-27
- 0.0.3 — 2022-08-27
- 0.0.2 — 2022-08-27

## README

## Commands

### `npx env-scripts diff <source-env-relative-path> <destination-env-relative-path>`
Compares environment variables defined in both env files, and reports any variables missing in either.

_Example:_

Given
```text
# .env.example

TEST_VAR_1=AAA
TEST_VAR_2=BBB
```

```text
# .env

TEST_VAR_1=AAA
TEST_VAR_3=CCC
```

running

`npx env-scripts diff .env.example .env`:

will result in
```text
Missing:
TEST_VAR_2

Extra:
TEST_VAR_3
```

Where "Missing" represents variables defined in `.env.example` but that are not found in `.env`, and "Extra" represents the inverse.


### `npx env-scripts sort <env-file-relative-path>`
Reads the env file and writes to a new file named `<env-file>-sorted`

_Example:_
`npx env-scripts sort .env` -> writes to a file named `.env-sorted`


### `npx env-scripts diff-values <env-1> <env-2>`
Compares value equality between two env files

---
_Source: https://npm.io/package/env-scripts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
