enumize
v1.0.6
Published
Simple js enum object creator
Downloads
3
Readme
enumize
Simple js functions converts arrays to enum objects.
Installation
npm install enumize
Usage
From array:
const enumize = require('enumize');
const myEnum = enumize(['zero', 'one', 'two']);
console.log(myEnum.one); // 1
From arguments list:
const enumize = require('enumize');
const myEnum = enumize('zero', 'one', 'two');
console.log(myEnum.one); // 1