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

obfuscemail

v0.1.2

Published

An email obfuscator utilising the rot13 cipher. Cuts down on spam in mailto links.

Downloads

12

Readme

Obfuscemail

Build Status Dependency Status

Adding contact email to your site is a great idea to allow people to contact you easily. However, it's also a great way to put your email address on a dish for spammy web crawlers.

Obfuscemail is a simple command line utility and Node.js module to help with this issue. It generates javascript which creates nice <a href="mailto:"> links which appear and work as normal in a web browser, but are not readable by web crawlers. The actual email address is hidden by the rot13 cipher.

Installation

To install the command line utility globally:

sudo npm install -g obfuscemail

Or to install locally in an npm project:

npm install obfuscemail --save

Usage

To use in a HTML page, you must define where you want your mailto links to be injected by using the obfuscemail class (ANY element with this class will be turned into a mailto link).

Then to generate the javascript to include in this page you need to run:

obfuscemail -e "<your email>" -t "Anchor Tag Text"

You can also add an optional subject to the mailto link:

obfuscemail -e "<your email>" -t "Anchor Tag Text" -s "Subject for Email"

Obfuscemail can also be used as a Node.js module (see above for installation):

var obfuscemail = require('obfuscemail');

var js = obfuscemail.generate('[email protected]', 'Contact Me');

console.log(js);
/* This outputs an immediately-invoked function expression, which you
 * *could*, if you really wish, eval()...
 */

Example

  1. Add <span class="obfuscemail">No email here!</span> to a HTML page.
  2. Generate the javascript <script> tag with obfuscemail -e [email protected] -t "Contact Me!". Cut and paste it into your HTML.
  3. When the browser loads the page, the span element will be replaced with <a href="mailto:[email protected]">Contact Me!</a>

FAQs

  1. Why use the rot13 cipher?
    It adds the main layer of obfuscation. Bots with an email matching regex over the whole page will be fooled by this.
  2. But if enough people use rot13, bots will be be written to use it too.
    Yeah, they will. We'll cross that bridge when we get to it.
  3. Eurgh, Node.js command line utilities are horrible!
    Yeah, they are. But so's your face.