# envuments

> A config system which allows you to pull formatted data from your desired key-value config store.

Latest version **1.1.0** (published 2025-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install envuments
pnpm add envuments
yarn add envuments
bun add envuments
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2025-03-21 |
| First published | 2020-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mason Rogers |
| Maintainers | victiondev |
| Keywords | env, .env, dotenv, environment, variables, config, configuration, settings |

## Links

- npm: https://www.npmjs.com/package/envuments
- Repository: https://github.com/victiondev/envuments
- Homepage: https://github.com/victiondev/envuments#readme
- Issues: https://github.com/victiondev/envuments/issues
- npm.io page: https://npm.io/package/envuments

## Dependencies (1)

- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0

## 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) — 2025-03-21
- 1.0.10 — 2020-04-19
- 1.0.9 — 2020-04-06
- 1.0.8 — 2020-01-24
- 1.0.7 — 2020-01-23
- 1.0.6 — 2020-01-22
- 1.0.5 — 2020-01-22
- 1.0.4 — 2020-01-22
- 1.0.3 — 2020-01-22
- 1.0.2 — 2020-01-22
- 1.0.1 — 2020-01-22
- 1.0.0 — 2020-01-22

## README

# Envuments - Your ideal config system

[![Downloads](https://img.shields.io/npm/dt/envuments.svg)](https://www.npmjs.com/package/envuments)
[![npm bundle size](https://img.shields.io/bundlephobia/min/envuments)](https://www.npmjs.com/package/envuments)
[![Version](https://img.shields.io/npm/v/envuments.svg)](https://www.npmjs.com/package/envuments)
[![License](https://img.shields.io/npm/l/envuments)](https://www.npmjs.com/package/envuments)

---

Envuments is an application configuration program that provides the ability to work with with .env files or your own seeded config.
The purpose of Envuments is to allow templating in your configuration files. Currently we support .env files as well as allowing you to seed your own config.
Syntax for templating and implementation can be found below.

When working with .env files, Envuments acts as an extension to the dotenv package which can be found [here](https://npmjs.com/dotenv).

&nbsp;

## Implementation

### .env

```env
APP_PORT=8443
APP_URL=http://localhost:${APP_PORT}
IS_PRODUCTION=true
```

### JavaScript usage exaple

```js
const { Envuments } = require('envuments');

const configValue = Envuments.get('APP_URL', 'https://viction.dev');

console.log(configValue); // http://localhost:8443
```

### TypeScript usage example (without annotations)

```ts
import { Envuments } from 'envuments';

const configValue = Envuments.get('APP_URL', 'https://viction.dev');

console.log(configValue); // http://localhost:8443
```

### TypeScript usage example (with annotations)

```ts
import { Env } from 'envuments';

class ExampleConfig {
   @Env('APP_URL', 'https://viction.dev')
   public readonly url: string;

   @Env('APP_PORT', 5123, Number)
   public readonly port: number;

   @Env('IS_PRODUCTION', false, Boolean)
   public readonly isProd: boolean;
}

const exampleConfig = new ExampleConfig();
console.log(exampleConfig.url); // http://localhost:8443

console.log(exampleConfig.port); // 8443

console.log(exampleConfig.isProd); // true
```

&nbsp;

## Seeding your own config

### index.js

```js
const { Envuments } = require('envuments');

Envuments.SeedConfig({
   APP_PORT: 8443,
   APP_URL: 'http://localhost:${APP_PORT}'
});

const config = new Envuments();

const configValue = config.get('APP_URL', 'https://viction.dev');

console.log(configValue); // http://localhost:8443
```

---

If you want any configuration methods to be implemented please [open an issue](https://github.com/victiondev/envuments/issues).

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