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

@khinshankhan/emoji-helper-core

v3.0.1

Published

The heart of emoji-helper

Readme

emoji-helper-core

The heart of emoji-helper

This package allows you to define a strongly typed map of emoji data to use in your project. It should likely be used with other packages in emoji-helper.

This package gives you the freedom to source your emoji from sources other than just a tweemoji pack. You're free to use your custom emoji from Discord or Slack, and even animated emoji! It's all just name <-> url (+ some meta info) at its core.

Install

pnpm add @khinshankhan/emoji-helper-core

Usage

You need to define an "emoji pack". Whether it's a single pack or multiple packs, you would just do

export const emojiLookup = createEmojiLookup([pack1, pack2, packn], true, true);

to create the strongly typed lookup. It's also recommended to use the following type:

type MapKey<T> = T extends Map<infer K, any> ? K : never;
export type EmojiKey = MapKey<typeof emojiLookup>;

Afterwards you can use the lookup like const emojiInfo = emojiLookup.get(name) and proceed to use the emoji info. Note that the name will have to have colons surrounding it, eg tada would be :tada:.

Params

createEmojiLookup takes in

  • emojiPacks of type EmojiPack[]
    • info about the emoji you'd like to use in the lookup, view "emoji pack"
  • overwrite of type boolean
    • defaults to false
    • if a duplicate emoji name is encountered, should it overwrite previous info?
  • merge of type boolean
    • default to false
    • if a duplicate emoji name is encountered, should it attempt to merge with previous info?
  • supressOverwriteWarnings of type boolean
    • defaults to false
    • if a duplicate emoji name is encountered, should it throw an error? (useful for injections eg with emoji-helper-remark)

Emoji Pack

An emoji pack is simply info about a collection of emoji. A single emoji's info should be

export interface EmojiInfoTemplate {
  names: readonly string[];
  url: string;

  char?: string;
  description?: string;
}

where only names and url are needed. names are the emoji name and any aliases associated with it. It's an array because aliases are apparently common enough, eg :octagonal_sign: and :stop_sign:.

char may come in handy if, for example, you create a component that needs an ascii character such as

<img
  src={emojiInfo.url}
  alt={emojiInfo.char}
  aria-label={emojiInfo.alt}
  height="72px"
  width="72px"
/>

If you need custom info, rather than abusing char or description, let me know so I can add a new field to the type. Personally haven't needed it so I've just skimped out on it to make a package available immediately.

TODO

  • allow names to be a single string or multiple strings
  • allow for optional surrounding colons