ts-enum-extractor

Enum-ts is a javascript module that extract either values or keys of the enum.

Usage no npm install needed!

<script type="module">
  import tsEnumExtractor from 'https://cdn.skypack.dev/ts-enum-extractor';
</script>

README

ts-enum-extractor

Library to help you extract a enum variables or keys.

Installation

To install ts-enum-extractor, use npm:

npm install ts-enum-extractor

Usage

enum DIRECTION {
   LEFT = 1,
   RIGHT = 2,
   UP = 3,
   DOWN = 4
 }
 
 // to get the keys of the enums
 
 console.log(enumExtractor.keys(DIRECTION))
 
 // to get the values of the enums
 
 console.log(enumExtractor.values(DIRECTION))