ne

node-enums

A simple Javascript ES6 enumerated type library.

Showing:

Popularity

Downloads/wk

5

GitHub Stars

0

Maintenance

Last Commit

4yrs ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-enums

Simple Javascript ES6 enumerated types.

Installation

npm install node-enums

Usage

var Enum = require('node-enums');
var Mode = Enum(['BEST','WORST']);

console.log(Mode.BEST);
// BEST

console.log(Mode.toArray());
// [ 'BEST', 'WORST' ]

console.log(Mode.toString());
// Enum{BEST, WORST}

console.log(Mode['BE'+'ST']);
// BEST

console.log(Mode.DECENT);
// throws Error

for (let member of Mode) {
  console.log(member);
}
// BEST
// WORST

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100