Skip to content

Instantly share code, notes, and snippets.

View The-LukeZ's full-sized avatar
💭
I may be slow to respond.

LukeZ The-LukeZ

💭
I may be slow to respond.
View GitHub Profile
@The-LukeZ
The-LukeZ / README.md
Last active October 30, 2025 10:46
Typesafe NodeCache

NodeCache already has Typescript support, however, you always need to pass your type when using cache.get() for example.

Below you can find an example of a cache factory which provides a full typesafe interface while only providing the type once.

How it works? The type interface for the NodeCache already has dynamic types and I only wrapped it in a wrapper-function and enhanced the JSDoc comments.

@The-LukeZ
The-LukeZ / discord-markup-parser.ts
Last active August 24, 2025 20:38
Discord Markup Parser for better markdown parsing
/** MarkdownParser.ts
*
* Tokenization-first markdown -> HTML implementation
*
* Features:
* - Bold: **bold**
* - Italic: *italic* or _italic_
* - Underline: __underline__
* - Subtext: lines starting with "-# "
* - Strikethrough: ~~strike~~