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

@sfirew/minecraft-motd-parser

v1.1.6

Published

Minecraft Server MOTD Parser, can convert to html, json, text.

Readme

Minecraft Server MOTD Parser

Version npm version License npm weekly downloads

A powerful and lightweight library to parse Minecraft server MOTD (Message of the Day) data into various formats.

Table of Contents

Features

Zero Dependencies - Lightweight and fast
🔄 Auto Detection - Automatically detects MOTD data type
🎨 Multiple Formats - Convert to HTML, JSON, or clean text
🌈 Full Color Support - Including Minecraft 1.16+ hex colors
📦 Module Support - CommonJS, ES Modules, and tree shaking
🎯 TypeScript Ready - Full TypeScript support

Installation

Choose your favorite package manager:

# npm
npm install @sfirew/minecraft-motd-parser

# yarn
yarn add @sfirew/minecraft-motd-parser

# pnpm
pnpm add @sfirew/minecraft-motd-parser

Quick Start

ES6 Modules

import { autoToHTML } from '@sfirew/minecraft-motd-parser'

const motd = "§aHypixel Network §7§c1.8/1.9/1.10/1.11/1.12 §e§lNEW PTL GAME:§b§l THE BRIDGE";
const html = autoToHTML(motd);
console.log(html);

CommonJS

const { autoToHTML } = require('@sfirew/minecraft-motd-parser');

Default Import

import motdParser from '@sfirew/minecraft-motd-parser'
motdParser.autoToHTML('motdString...');

API Reference

Auto Detection

autoToHTML(data: string | object): string

Automatically detects the MOTD data type and converts it to HTML.

import { autoToHTML } from '@sfirew/minecraft-motd-parser'

// Works with both text and JSON formats
const textMOTD = "§aHypixel Network §c1.8-1.19";
const jsonMOTD = { text: "", extra: [{ color: "green", text: "Hello World" }] };

console.log(autoToHTML(textMOTD));
console.log(autoToHTML(jsonMOTD));

autoCleanToText(data: string | object): string

Automatically detects the MOTD data type and returns clean text without formatting codes.

import { autoCleanToText } from '@sfirew/minecraft-motd-parser'

const motd = "§aHypixel Network §c1.8-1.19";
console.log(autoCleanToText(motd)); // "Hypixel Network 1.8-1.19"

Text Parsing

textToHTML(text: string): string

Converts MOTD text format to HTML.

import { textToHTML } from '@sfirew/minecraft-motd-parser'

const motd = "§aGreen §lBold §rReset §cRed";
const html = textToHTML(motd);
// Output: <span style="color:#55FF55;">Green <span style="font-weight:bold;">Bold </span></span><span style="color:#FF5555;">Red</span>

textToJSON(text: string): object

Converts MOTD text format to JSON structure.

import { textToJSON } from '@sfirew/minecraft-motd-parser'

const motd = "§aHello §bWorld";
const json = textToJSON(motd);
console.log(json);

JSON Parsing

JSONToHTML(json: object): string

Converts MOTD JSON format to HTML.

import { JSONToHTML } from '@sfirew/minecraft-motd-parser'

const motdJson = {
  text: "",
  extra: [
    { color: "green", text: "Hello " },
    { color: "blue", text: "World", bold: true }
  ]
};

const html = JSONToHTML(motdJson);

Clean Text

cleanCodes(text: string): string

Removes all formatting codes from MOTD text.

import { cleanCodes } from '@sfirew/minecraft-motd-parser'

const motd = "§aHypixel Network §c1.8-1.19";
const clean = cleanCodes(motd);
console.log(clean); // "Hypixel Network 1.8-1.19"

Examples

Complex MOTD with Multiple Formats

import motdParser from '@sfirew/minecraft-motd-parser'

// Text format example
const textExample = "§aHypixel Network §7§c1.8/1.9/1.10/1.11/1.12 §e§lNEW PTL GAME:§b§l THE BRIDGE";
console.log(motdParser.autoToHTML(textExample));

// JSON format example
const jsonExample = {
  "text": "",
  "extra": [
    { "bold": true, "color": "gold", "text": "Viper " },
    { "color": "gray", "text": "┃ " },
    { "color": "yellow", "text": "Summer Sale" },
    { "color": "white", "text": " at " },
    { "color": "gold", "text": "store.vipermc.net\n" }
  ]
};
console.log(motdParser.autoToHTML(jsonExample));

Visual Examples

The parser supports rich formatting including colors, bold, italic, underline, and strikethrough text.

With Minecraft Font

Minecraft Font Example

Standard Font

Standard Font Example

Try it live: Check out the Minecraft Server Status Viewer to see the parser in action.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.