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

@neabyte/unicode-gen

v1.0.1

Published

A lightweight TypeScript library for generating random Unicode emojis with embedded data for instant offline usage

Readme

Unicode-Gen 🎲

A lightweight TypeScript library for generating random Unicode emojis. Features embedded Unicode data for instant offline usage with 3,781+ emojis across 100 categories.

NPM Version NPM Downloads License: MIT TypeScript Node.js

✨ Features

  • 🚀 Instant startup - No network requests, embedded data
  • 📦 Offline ready - Works without internet connection
  • 🎲 3,781+ emojis - Latest Unicode emoji data
  • 📂 98 categories - Organized by emoji type
  • Lightweight - Minified browser bundle (~176KB, 26KB gzipped)
  • 🔧 TypeScript - Full type safety and IntelliSense
  • 🌐 Universal - Works in Node.js, browser, and standalone
  • 🎯 Zero dependencies - No external files or network requests

📦 Installation

Node.js

npm install @neabyte/unicode-gen

Browser

<!-- Via CDN -->
<script src="https://unpkg.com/@neabyte/unicode-gen@latest/dist/unicode-gen.min.js"></script>

<!-- Or download and include locally -->
<script src="path/to/unicode-gen.min.js"></script>

<!-- ES Modules -->
<script type="module">
  import generator from 'https://unpkg.com/@neabyte/unicode-gen@latest/dist/unicode-gen.esm.js'
</script>

🚀 Quick Start

Node.js

import generator from '@neabyte/unicode-gen'

// Get random emoji
generator.random() // '😀'

Browser

// Access the global UnicodeGen object
const generator = UnicodeGen.default

// Get random emoji
generator.random() // '😀'

Basic Examples

import generator from '@neabyte/unicode-gen'

// Get random emoji (default)
generator.random() // '😀'

// Get random emoji code
generator.random({ type: 'code' }) // '1F600'

// Get multiple random emojis
generator.random({ count: 5 }) // ['😀', '😃', '😄', '😁', '😆']

// Get from specific category
generator.random({ category: 'face-smiling' }) // '😀'

// Get full emoji object
generator.random({ type: 'both' }) // { code: '1F600', emoji: '😀' }

🔧 API Reference

generator.random(options?: RandomOptions)

Generate random emojis with flexible options.

Options:

  • count?: number - Number of emojis to return (default: 1)
  • category?: string - Specific category to choose from
  • type?: 'code' | 'emoji' | 'both' - Return format (default: 'emoji')

Type Examples:

  • type: 'emoji' - Returns emoji characters (default)
  • type: 'code' - Returns Unicode codes
  • type: 'both' - Returns full objects with code and emoji

Returns:

  • Single emoji: string or EmojiData
  • Multiple emojis: string[] or EmojiData[]

generator.getCategories()

Returns array of available category names.

generator.getEmojisByCategory(category: string)

Returns all emojis in the specified category.

🚀 Advanced Usage

Standalone Usage

// Create your own instance
import { UnicodeGenerator } from '@neabyte/unicode-gen'

const generator = new UnicodeGenerator()
await generator.loadData()

// Use like normal
generator.random() // '😀'

Category Management

// Get all available categories
const categories = generator.getCategories()
console.log(categories) // ['face-smiling', 'heart', 'animal-mammal', ...]

// Get all emojis from a category
const hearts = generator.getEmojisByCategory('heart')
console.log(hearts.length) // 25
console.log(hearts.map(e => e.emoji).join(' ')) // '💌 💘 💝 💖 💗 ...'

Validation Examples

// Validate category exists
const categories = generator.getCategories()
if (categories.includes('face-smiling')) {
  const emoji = generator.random({ category: 'face-smiling' })
}

// Handle invalid options
try {
  generator.random({ count: 0 }) // Throws error
} catch (error) {
  console.log('Invalid count:', error.message)
}

📂 Available Categories

Your library includes 98 emoji categories:

😊 Faces & Emotions

  • face-smiling, face-affection, face-tongue, face-hand
  • face-neutral-skeptical, face-sleepy, face-unwell
  • face-hat, face-glasses, face-concerned, face-negative
  • face-costume, cat-face, monkey-face, heart, emotion

🐾 Animals & Nature

  • animal-mammal, animal-bird, animal-amphibian
  • animal-reptile, animal-marine, animal-bug
  • plant-flower, plant-other

🍕 Food & Drink

  • food-fruit, food-vegetable, food-prepared
  • food-asian, food-sweet, drink, dishware

🏠 Places & Transport

  • place-map, place-geographic, place-building
  • place-religious, place-other
  • transport-ground, transport-water, transport-air

👤 People & Activities

  • person, person-gesture, person-role, person-fantasy
  • person-activity, person-sport, person-resting
  • family, person-symbol

🎮 Objects & Symbols

  • clothing, sound, music, musical-instrument
  • phone, computer, light-video, book-paper
  • money, mail, writing, office, lock, tool
  • science, medical, household, other-object

🚦 Signs & Symbols

  • transport-sign, warning, arrow, religion, zodiac
  • av-symbol, gender, math, punctuation, currency
  • other-symbol, keycap, alphanum, geometric

🏁 Flags

  • flag, country-flag, subdivision-flag

📚 Documentation

For complete API reference and examples, see the full documentation.

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT © NeaByteLab