# constant-enum

> creates a frozen object with matching keys and values

Latest version **1.0.1** (published 2014-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install constant-enum
pnpm add constant-enum
yarn add constant-enum
bun add constant-enum
```

## 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.0.1 |
| Published | 2014-08-12 |
| First published | 2014-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dominic Barker |
| Maintainers | dakuan |
| Keywords | flux, react, immutable, constant, enumeration, enum |

## Links

- npm: https://www.npmjs.com/package/constant-enum
- Repository: https://github.com/Dakuan/constant-enum
- Issues: https://github.com/Dakuan/constant-enum/issues
- npm.io page: https://npm.io/package/constant-enum

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ^1.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2014-08-12
- 1.0.0 — 2014-08-12

## README

[![Build Status](https://travis-ci.org/Dakuan/constant-enum.svg?branch=master)](https://travis-ci.org/Dakuan/constant-enum)
constant-enum
=============

Generates a frozen object with matching keys and values

## Installation

```bash
$ npm install constant-enum
```

## Usage

```javascript
var en = require('constant-enum');
en('MON', 'TUES', 'WEDS');
// or
en.apply(null, ['MON', 'TUES', 'WEDS']);
// results in ->
{
  MON: 'MON',
  TUES: 'TUES',
  WEDS: 'WEDS'
}
```

## Why?
We found this pattern helpful when implementing [Facebook's Flux architecture](http://facebook.github.io/react/docs/flux-overview.html). We use this pattern as an alterative to the one demonstrated in the [Flux TodoMVC example](https://github.com/facebook/flux/blob/master/examples/flux-todomvc/js/constants/TodoConstants.js).

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