tm-text is a library for parsing and formatting Trackmania and ManiaPlanet game text, converting color codes and formatting tokens (e.g., $f00 for red, $o for bold) into HTML, human-readable strings, or tokenized structures. The current version is 1.1.0, released on npm. It supports both ESM and CommonJS, ships TypeScript types, and is actively maintained on GitHub by Brainshaker95. Compared to alternatives, it provides a simple interface with functions like humanize, htmlify, tokenize, and blockify, covering all documented tokens including color codes, bold, italic, links, and shadow.
npm install tm-textNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses Trackmania formatted text, then converts to human-readable string and HTML with color spans.
Use '$$' in the input string to represent a single '$' character.
Ensure all color tokens follow the pattern $[0-9a-fA-F]{3}.Check your Trackmania text for proper token nesting before using tm-text.
Plan migration to ESM imports for future versions.
Use const tmText = require('tm-text').default; or const { tmText } = require('tm-text');Run npm install tm-text and ensure import path is correct (no './').
Ensure 'node_modules' is in typeRoots, or add 'tm-text' to 'types' in tsconfig.json.
Use const { tmText } = require('tm-text'); instead of import.No dependency data recorded yet.