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

gemojify

v0.0.3

Published

A bit of JS that replaces colon :emoji: in HTML with images

Downloads

7

Readme

Gemojify

Front-end library that replaces colon :emoji: with images

Introduction

This is a front-end library that replaces text inside colons with a span element of a particular CSS class that will fetch its corresponding emoji. To find the right colon emoji to use, try emoji.muan.co. The images themselves were lovingly borrowed from emoji-cheat-sheet.com - I really wasn't looking forward to typing all the names manually, then I found this!

e.g. :smile: becomes smile emoji

The emoji scales to the size of the font, so emoji specified in <h1> tags will be larger than those in <p> tags.

Use in your project

Using NPM?

npm install gemojify

Or just download the repository from GitHub.

Copy the contents of the css, images and js directories into your project.

Inside your HTML, include a reference to css/gemojify.css and js/gemojify.js. Add an extra <script> tag that calls gemojify(). If you use that function with no parameters, gemojify() will process any HTML tags with the class gemojify. Alternatively you can pass your own selector to the function e.g. gemojify('h1') to process all <h1> tags, or gemojify('#that-element') to process the element with id that-element.

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="css/gemojify.css">
  </head>
  <body>
    <h1 class="gemojify">We :heart: emoji!</h1>
    <p class="gemojify">:thumbsup: This paragraph will be processed :tada:</p>
    <p>This paragraph won't :cry:</p>
    <script src="js/gemojify.js"></script>
    <script>
      gemojify(); // equivalent to gemojify('.gemojify')
    </script>
  </body>
</html>

becomes

Colon emoji inside the Gemojify class are converted to real emoji

Adding custom emoji

If you're one of those people who thinks "There is no such thing as too much emoji", you can add your own emoji, including animated GIFs!

  1. In order to update the CSS, you need gulp-cli installed (npm install gulp-cli -g).
  2. You also need to install the development dependencies: npm install
  3. Add more images to the images/emojis folder, making sure their filenames without extensions don't clash e.g. smile.png clashes with smile.gif (they would both be applied to the emoji-smile class)
  4. Finally, run gulp build. As if by magic, gemojify.css should have been updated with your new images!