Skip to content

A simple Javascript ES6 enumerated type library.

License

Notifications You must be signed in to change notification settings

fixate/node-enums

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.ALL);
// [ 'BEST', 'WORST' ]

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

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

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

About

A simple Javascript ES6 enumerated type library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%