mkenum
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

mkenum: make enum type in javascript

npm version

Install

Install via npm package:

yarn add mkenum

Usage

import makeEnum, {type IEnum} from 'mkenum'
// or
const makeEnum = require('mkenum')

const Env = makeEnum('a', 'b', 'c') // type {a: 'a', b: 'b', c: 'c'}
const a = Env.a // type 'a'
type EnvEnum = IEnum<typeof Env> // type 'a' | 'b' | 'c'

Readme

Keywords

none

Package Sidebar

Install

npm i mkenum

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

1.51 kB

Total Files

7

Last publish

Collaborators

  • tranvansang