TypeScript String Enums

JSON →
library 1.0.0 ·javascript deprecated
verified May 27, 2026

The `typescript-string-enums` library, currently at stable version 1.0.0, provided a mechanism for creating typesafe string enums in TypeScript environments prior to version 2.4. Its primary utility was to overcome limitations of native TypeScript number enums and the lack of native string enums, offering compile-time type safety for string values. Key features include the `Enum` factory function to define enums with either direct string values or mapped key-value pairs, helper functions like `Enum.isType()` for type guarding, and `Enum.keys()` and `Enum.values()` for strictly typed access to enum keys and values. The library also supports JSDoc comments for enum members and allows creating enums where keys are automatically mirrored as values using `Enum.ofKeys()`. While the library had a steady release cadence up to 0.3.x, development has largely ceased, with the 1.0.0 release being a commitment to stability rather than new features. This library is now largely superseded by native string enums introduced in TypeScript 2.4, which offer similar functionality without a third-party dependency. It is recommended to use native string enums in modern TypeScript projects.

total hits 16
actors 6 distinct systems
last hit 1d ago MJ12bot
GPTBot
5
MetaBot
4
Script
1
Search engines
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France