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

@diqi/emoji-search

v0.7.0

Published

A simple TypeScript package to search emojis from a JSON file.

Downloads

14

Readme

Emoji Search TS

A simple TypeScript library for searching emojis based on names, keywords, emoticons, tags, and country codes. It uses an enriched emoji dataset generated by the DeepSeek API.

npm install @diqi/emoji-search

Features

  • Search emojis by
    • Name (e.g., "cat face", "heart")
    • Semantic keywords (e.g., "love", "sad", "party")
    • Common emoticons (e.g., :), :P, <3, :x)
    • Tags (e.g., "animal", "food", "flag")
    • Country code (e.g., "US", "GB", "DE")
  • Uses a pre-generated JSON file for fast, local searching (no external API calls at runtime).
  • Includes a script to generate the enriched JSON data using the DeepSeek API.

Prerequisites

  1. Node.js and npm: Required for running the TypeScript package and build/test scripts. (Download Node.js)
  2. Python 3: Required for the metadata generation script. (Download Python)
  3. DeepSeek API Key: You need an API key from DeepSeek. (Sign up/Login at DeepSeek)

Setup

git clone https://github.com/dqii/emoji-search
cd emoji-search
npm install
pip install requests python-dotenv

Add your DeepSeek API key to .env:

DEEPSEEK_API_KEY=YOUR_DEEPSEEK_API_KEY_HERE

Data Generation (One-time Step)

The search functionality relies on an enriched data file (emojis-expanded.json) which needs to be generated using the provided Python script and your DeepSeek API key.

  1. Ensure .env file is set up with your DEEPSEEK_API_KEY.

  2. Run the generation script: From the project root directory (emoji-search), run:

    python scripts/generate_metadata.py

    This script will:

    • Read your API key from the .env file.
    • Read the base emojis.json file.
    • Query the DeepSeek API for each emoji to generate keywords, emoticons, descriptions, tags, and country codes.
    • Write the results to emojis-expanded.json in the project root.

    This process can take several minutes depending on your system, the number of emojis, and DeepSeek API limits/latency.

    (Note: If you modify emojis.json later, you'll need to re-run this script.)

Usage

npm install @diqi/emoji-search
import { searchEmojis } from '@diqi/emoji-search';

// --- Examples ---

// Search by keyword
const happyEmojis = searchEmojis('happy');
console.log('Happy:', happyEmojis.map(e => e.emoji));
// Example Output: Happy: [ '😀', '😃', '😄', '😁', '😆', '😅', '🤣', '😂', '🙂', '😊', '🥰', '🥳' ] (Results may vary based on generated data)

// Search by emoticon
const tongueEmojis = searchEmojis(':p');
console.log('Tongue Out:', tongueEmojis.map(e => e.emoji));
// Example Output: Tongue Out: [ '😛', '😜', '🤪', '😝' ]

// Search by country code
const ukFlag = searchEmojis('gb');
console.log('UK Flag:', ukFlag.map(e => e.emoji));
// Example Output: UK Flag: [ '🇬🇧' ]

// Search by name fragment
const catEmojis = searchEmojis('cat face');
console.log('Cat Faces:', catEmojis.map(e => e.emoji));
// Example Output: Cat Faces: [ '😺', '😸', '😹', '😻', '😼', '😽', '🙀', '😿', '😾' ]

// Limit results
const limitedFlags = searchEmojis('flag', 5);
console.log('Flags (max 5):', limitedFlags.map(e => e.emoji));

Development

Commands

git clone https://github.com/dqii/emoji-search
cd emoji-search
npm install
pip install requests

Build and test

npm run build
npm test

Publishing to npm

Ensure you have an npm access token with publish permissions in your .npmrc file.

//registry.npmjs.org/:_authToken=NPM_ACCESS_TOKEN

Before publishing, ensure you increment the version field in package.json.

npm login
npm run build
npm publish --access public