@ionx/enum

1.0.0 • Public • Published

Simple Enum

A simple JavaScript enum implementation. It can be used in every way an enum should be usable.

Installation

Like any other node package yarn add @ionx/enum Not using yarn? You should be!

Usage

const Enum = require('@ionx/enum')

var Fruit = Enum(['Apple', 'Kiwi', 'Banana', 'Tangerine', 'DragonFruit'])

var bestFruit = Fruit.DragonFruit

// Additional properties
// Fruit.keys: an array of all keys
// Fruit.length: number of keys

Licence

Released under the MIT licence.

Readme

Keywords

none

Package Sidebar

Install

npm i @ionx/enum

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • powerofm