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

@upstash/text2emoji

v1.0.0

Published

An SDK to convert text to its corresponding emoji based on semantic meaning using Upstash Vector.

Downloads

5

Readme

Text2Emoji

Overview

Text2Emoji is a Node.js SDK which maps input text to relevant emojis using a Vector-based similarity search powered by Upstash.

The key features include:

  • Semantic rather than full text search. e.g. delicious matches food emojis
  • A lightweight SDK for querying emoji data using an existing Upstash vector database.
  • A utility script to seed the vector index with emoji data (emoji_data.json).
  • Emoji data is enriched using OpenAI ChatGPT model.

Installation and Usage

Seed Vector Index

In this step, we will insert the Emoji data your Upstash Vector DB. So first you need to create an Index and select one of the available embedding models (do not choose custom).

Download or clone the repo.

Rename the .env.example file as .env and add your Upstash Vector DB URL and token.

Install dependencies then run the seed.js:

npm install
node scripts/seed.js

Check your Data Browser on Upstash console to ensure the emoji data inserted into the Upstash Vector index.

Basic Usage

Install by:

npm install @upstash/text2emoji
// examples/basic.js
import Text2Emoji from './src/sdk.js';
import dotenv from 'dotenv';

dotenv.config();

async function test() {
    const text2emoji = new Text2Emoji({
        vectorRestUrl: process.env.UPSTASH_VECTOR_REST_URL,
        vectorRestToken: process.env.UPSTASH_VECTOR_REST_TOKEN
    });

    console.log( await text2emoji.get("delicious", 5) );

    const testCases = [
        "love",
        "happy",
        "sad",
        "angry",
        "celebration",
        "food"
    ];


    for (const text of testCases) {
        const emojis = await text2emoji.get(text, 3);
        console.log(`Emojis for "${text}":`, emojis);
    }
}

test().catch(console.error);

Contributing

Feel free to raise issues or submit pull requests to improve this package or add additional features.