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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@matrix-js/irc-formatting

v0.0.1

Published

Convert between basic HTML markup and IRC formatting codes

Readme

@matrix-js/irc-formatting

HTML to IRC

Convert basic HTML markup elements to IRC formatting codes. Intended for a subset of the HTML elements defined in the Matrix m.room.message spec. Unknown elements will have their tags discarded (but not their content).

| HTML | IRC | Style |---|---|---| | <b>, <strong> | 0x02 | Bold | | <i>, <em> | 0x1D | Italics | | <u> | 0x1F | Underline | | <s>, <del> | 0x1E | Strikethrough | | <code> | 0x11 | Monospace | | <font>, <span> | 0x03 | Color |

For <font> and <span> to set the foreground and background color, these attributes are used: | Attribute | Color |---|---| | data-mx-color, color | Foreground | | data-mx-bg-color, bgcolor | Background | | data-mx-spoiler | Spoiler (foreground and background colors set to gray) |

For usage in combination with sanitize-html or sanitize-replace-html to sanitize/transform HTML beforehand, this package exports the allowedTags and allowedAttributes it is able to properly use.

Example

const { htmlToIrc } = require("@matrix-js/irc-formatting");

const html = `<b>bold</b> <b>bold <i>with <span color="red">red italics</span></i> <span color="black" bgcolor="lime">limes limes limes</span></b> normal text <span bgcolor="red">red bg<span bgcolor="yellow" color="black"><b>CYBER</b></span>red bg continues</span>`;

let result = htmlToIrc(html);

console.log("html:", html);
console.log("irc:", result);
// \x02bold\x02 \x02bold \x02\x1dwith \x04FF0000\x02\x1dred italics\x04\x02 \x04000000,00FC00\x02limes limes limes\x04\x02 normal text \x04FFFFFF,FF0000red bg\x04000000,FFFF00\x02CYBER\x04FFFFFF,FF0000\x02red bg continues

console.log("allowedTags:", htmlToIrc.allowedTags);
console.log("allowedAttributes:", htmlToIrc.allowedAttributes);

IRC to HTML

Work in progress.

License, donations

GPL-3.0. If you want to support my work, you can:

Changelog

0.0.1 (December 23, 2024)

  • Initial release