@ionx/enum
v1.0.0
Published
A simple, zero-dependency JavaScript enum implementation
Downloads
3
Readme
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.