npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tm-essentials

v1.3.0

Published

A lightweight library in Node.js that provides formatting features and little additions for any development related to Trackmania.

Readme

Trackmania Essentials (for Node.js)

GitHub release

npm NPM Size

Unit Tests

A light-weight library that provides formatting features for Trackmania games.

Installation

Node.js

npm install tm-essentials

Then you can retrieve the library with:

const TMEssentials = require('tm-essentials');

Browser

<script src="https://unpkg.com/tm-essentials"></script>

Then you can retrieve the library from the global variable TMEssentials

Methods & properties

Text formatting

TextFormatter.formatCodesRegex

RegExp to match all the formatting codes

TextFormatter.colorCodesRegex

RegExp to match all the color formatting codes

TextFormatter.deformat()

Deformat the text

let formatted = "$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085 $094v$0A30$0B1.$0C01";
let deformatted = TextFormatter.deformat(formatted);
console.log(deformatted);

// Output: TMU.KrazyColors v0.1

You can pass options in it:

  • colorOnly: Deformat color codes only

TextFormatter.formatAnsi()

Will parse the color formatting and convert it to ANSI escape codes. Works best on console output.

let formatted = "$l[https://kc.jfreu.com/]$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085$l $094v$0A30$0B1.$0C01";
let ansiFormat = TextFormatter.formatAnsi(formatted);
console.log(ansiFormat);

You can pass options in it:

  • disableLinks: will disable links to external sites (false by default)
  • disableColor: will disable colors while keeping the text styles (false by default)
  • lightBackground: adapt color to be visible on light backgrounds (false by default)
  • colorDepth: color depth of the ANSI escape codes, either "4bit", "8bit" or "24bit" ("24bit" by default)
let formatted = "$l[https://kc.jfreu.com/]$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085$l $094v$0A30$0B1.$0C01";
let ansiFormat = TextFormatter.formatAnsi(formatted, {
  disableLinks: true,
  lightBackground: true,
  colorDepth: "8bit"
});
console.log(ansiFormat);
let formatted = "$l[https://kc.jfreu.com/]$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085$l $094v$0A30$0B1.$0C01";
let ansiFormatNoColor = TextFormatter.formatAnsi(formatted, {
  disableLinks: true,
  disableColor: true
});
console.log(ansiFormatNoColor);

TextFormatter.formatHtml()

This is a port of the original Maniaplanet style parser written in pure JS. Copyright © 2012 - 2026 Nadeo & Baptiste Lafontaine

let formatted = "$l[https://kc.jfreu.com]$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085$l $094v$0A30$0B1.$0C01";
let htmlFormat = TextFormatter.formatHtml(formatted);
document.querySelector("#result").innerHTML = htmlFormat;

You can pass options in it:

  • disableLinks: will disable links to external sites (false by default)
  • lightBackground: adapt color to be visible on light backgrounds (false by default)
  • linkTarget: add a target attribute into links
let formatted = "$l[https://kc.jfreu.com]$F00T$D01M$C13U$A14.$815K$727r$528a$329z$23By$03CC$03Co$04Bl$059o$068r$077s$085$l $094v$0A30$0B1.$0C01";
let htmlFormat = TextFormatter.formatHtml(formatted, {
  disableLinks: true,
  lightBackground: true
});
document.querySelector("#result").innerHTML = htmlFormat;
let formatted = "$l[https://greep.fr]Open this link to a new tab$l with the target attribute";
let htmlFormat = TextFormatter.formatHtml(formatted, {
  linkTarget: "_blank"
});
document.querySelector("#result").innerHTML = htmlFormat;

Time formatting

Time.fromMilliseconds(1337).toTmString(); // "0:01.337"
Time.fromMilliseconds(1337).toTmString(true); // Will use hundredths as output: "0:01.33"

Time.fromSeconds(13.37).toTmString(); // "0:13.370"
Time.fromMinutes(13.37).toTmString(); // "13:37.000"
Time.fromHours(13.37).toTmString(); // "13:37:00.000"

Time.noTime.toTmString(); // "-:--.---"

TimeSpan

TimeSpan will return a Time class when one of noTime property or thoses methods is used:

  • Time.noTime
  • Time.fromMilliseconds()
  • Time.fromSeconds()
  • Time.fromMinutes()
  • Time.fromHours()

Time class

Time.time - Total milliseconds as integer value.

Time.toTmString() - Outputs the time to a formatted Trackmania-like string

Accounts formatting

Accounts.toAccountId()

Accounts.toAccountId("Jtmn3kBnSSadky_mLNhp_A") // "26d9a7de-4067-4926-9d93-2fe62cd869fc"

Accounts.toLogin()

Accounts.toLogin("26d9a7de-4067-4926-9d93-2fe62cd869fc") // "Jtmn3kBnSSadky_mLNhp_A"

Contributions

Alt