# env-profiles

> Dead simple .env profile switching with yaml config

Latest version **0.1.5** (published 2022-11-03) · MIT license · 0 weekly downloads

## Install

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

Provides the command `env-profiles`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2022-11-03 |
| First published | 2022-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | David Skrenta |
| Maintainers | dskrenta |

## Links

- npm: https://www.npmjs.com/package/env-profiles
- Repository: https://github.com/dskrenta/env-profiles
- Issues: https://github.com/dskrenta/env-profiles/issues
- npm.io page: https://npm.io/package/env-profiles

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0

## Recent versions

- 0.1.5 (latest) — 2022-11-03
- 0.1.4 — 2022-02-10
- 0.1.3 — 2022-02-10
- 0.1.2 — 2022-02-10
- 0.1.1 — 2022-02-10
- 0.1.0 — 2022-02-10

## README

# env-profiles
**Dead simple .env profile switching with yaml config**

[![https://nodei.co/npm/YOUR-MODULE-NAME.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/env-profiles.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/env-profiles)

Sample `env.yml` configuration
```
default:
  # comment...
  default: true

dev: 
  default: false
  dev: true
  foo: bar
```

Switch profiles
```
$ env-profiles default
Switched to the default profile

$ cat .env
default=true
```

When using custom profiles values are inherited from the default profile, then duplicates are overwritten by custom profile values
```
$ env-profiles dev
Switched to the dev profile

$ cat .env
default=false
dev=true
foo=bar
```

`env-profiles` looks for the `env.yml` configuration file and writes the `.env` file in your current working directory of execution.

**Don't forget to add `env.yml` to your `.gitignore`!**

## Install

The easiest way to use `env-profiles` is to install it globally as a Node command line program. Run the following command in Terminal:

```
$ npm install --global env-profiles
```

Or, you can install `env-profiles` locally, for use in a single project:

```
$ npm install --save-dev env-profiles
```

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