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

mailshine

v2.0.0

Published

A simple and lightweight library that cleans html email content for use in other environments like webpages.

Readme

mailshine

A simple and lightweight library that cleans html email content for use in other environments.

Email clients will often populate emails with style and class tags in the HTML they send. In addition, email clients will quote the entire previous email chain with each reply. While all these techniques work for traditional email, they cause headaches for email integration into other apps.

This library solves this problem.

Overview

Mailshine uses regex patterns to detect the beginning of the quoted part of an email. All content at and after that point is removed.

There is no common format for quoted email replies. Email clients often devise their own way of indicated quoted content. Mailshine includes regex patterns that capture the email replies of the following email clients:

  • Apple iPhone
  • Gmail
  • Apple iPad
  • Google Android
  • Apple Mail Web client
  • Outlook
  • Yahoo
  • Outlook web client
  • Thunderbird

This list covers more than 90% of email clients in use. It may be safe to assume that the coverage is a few % higher because less used clients likely use some of the same patterns to indicate email replies. Source

If you find an email client that uses a reply format that is not picked up by the included regex patterns, you can add your own custom regex patterns. In addition, if you find that one of the current patterns is incorrectly parsing or causing unwanted side effects, you can remove specific regex patterns if wanted. For usage, view the Usage section below.

If their is broader applications to the addition or subtraction of a regex pattern, please open an issue.

Setup

At the moment Mailshine is only available on Node. A browser compatible version is coming soon.

Install via console: npm install mailshine

Usage

const Mailshine = require('mailshine');

const adds = [/reply:/g];
const removes = [/\\>.*?[\s]\>/g];

html = "<p>Hi Warren! Tennis this weekend?</p><div>To: mikejonesab12@gmail, From: Warren Buffet</div><p>Hey, it's your pal Warren :)</p>";


let output = Mailshine(html); // without any custom adds or removes.
output = Mailshine(html, {adds, removes}); // without any custom adds or removes.

//Output:
{
    htmlContent: "<p>Hi Warren! Tennis this weekend?</p>",
    htmlQuote: "<div>To: mikejonesab12@gmail, From: Warren Buffet</div><p>Hey, it's your pal Warren :)</p>",
    markdownContent: "Hi Warren! Tennis this weekend?",
    markdownContent: "To: mikejonesab12@gmail, From: Warren Buffet\n\nHey, it's your pal Warren :)"
}

Todo

  • Add tests