1.3.1 • Published 3 years ago

mcmotdparser v1.3.1

Weekly downloads
6
License
GPL-3.0
Repository
github
Last release
3 years ago

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):

FileSize
motdparserweb.js.gz1424 bytes
mcmotd.css.gz491 bytes

=> 1.9 kB all together

1.3.1

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago