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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mcmotdparser

v1.3.1

Published

A parser for Minecraft Motds in the old style (plain text) and in the new style (json).

Downloads

25

Readme

MCMotdParser Build Status

A parser for Minecraft motds which parses them to HTML

Supports parsing old and new format motds to HTML and parsing old format motds to new JSON format motds.

Usage NodeJS:
Install from npm (see https://www.npmjs.com/package/mcmotdparser):
npm install motdparser

const motdparser = require('mcmotdparser');
var motd = "§aSuper cool Server §7Come join us! §e§lNEW GAME:§b§l THE BRIDGE";
var html = "";
motdparser.toHtml(motd, (err, res) => {
	html = res;
});

Usage Web:

// Include this tag in your head or below your body
<script src="https://cdn.jsdelivr.net/gh/nailujx86/mcmotdparser@master/dist/motdparserweb.js" type="text/javascript"></script>

<script>
	var motd = "§aSuper cool Server §7Come join us! §e§lNEW GAME:§b§l THE BRIDGE";
	var html = "";
	motdParser.toHtml(motd, function(err, res) {
		html = res; // Do with this whatever you want :)
	});
</script>

To convert a "text" style motd to a modern json motd one can use motdParser.textToJson("motdtext", callback);

The CSS File which helps styling the output are in the dist/ Folder and on https://cdn.jsdelivr.net/gh/nailujx86/mcmotdparser@master/dist/mcmotd.css. Parsing is supported for motds in text format as well as motds in the Minecraft Json-Text Format.

Renders:

Render of the example above:
Motd0
Another example:
Motd1
And one last example:
Motd2

Size (gipped):

| File | Size | | ---- | ---- | | motdparserweb.js.gz | 1424 bytes | | mcmotd.css.gz | 491 bytes | => 1.9 kB all together