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

random-words-slugs

v1.1.0

Published

A lightweight, fast, and feature-rich random word slug generator with emoji, numbers, custom formats, and more.

Downloads

28

Readme

random-words-slugs

npm version bundle size license

A lightweight, fast, and feature-rich random word slug generator.

brave-golden-fox          ← default (kebab, 3 words)
BraveGoldenFox            ← pascal format
brave_golden_fox-42       ← with number
🦊 brave-golden-fox       ← with emoji
apple-ant-art             ← alliteration

Features

  • 🪶 Tiny — zero dependencies, < 5 KB minzipped
  • Fast — pure in-memory, no I/O
  • 🎨 8 formats — kebab, snake, camel, pascal, title, upper, dot, path
  • 🔐 Secure & Seeded — deterministic PRNG seeds or cryptographically secure WebCrypto randoms
  • 🎭 Themes & Alliteration — scoped noun themes and forced alliteration configurations!
  • 🔢 Number suffix — e.g. swift-fox-247
  • 😎 Emoji support — prepend or append from curated sets
  • 📝 4 word types — adjectives, nouns, verbs, adverbs
  • ✏️ Custom word lists — bring your own words
  • 📏 maxLength — trim slug to fit a character limit
  • 🔵 TypeScript — full types included

Install

npm install random-words-slugs
# or
yarn add random-words-slugs
# or
pnpm add random-words-slugs

Quick Start

import generateSlug from "random-words-slugs";

generateSlug();
// "brave-golden-fox"

generateSlug(2);
// "tiny-wolf"

API

generateSlug(wordCount?, options?)

Generates a single random slug. You can pass the properties directly via an options object, or supply a wordCount digit as the first parameter!

generateSlug()
// "brave-golden-fox"

generateSlug(4)
// "calm-wild-golden-fox"

generateSlug({ format: "camel", wordCount: 2 })
// "tinyWolf"

generateSlug(3, { alliteration: true })
// "fierce-fast-falcon"

Options

| Option | Type | Default | Description | |-----------------|-----------------------|--------------------------------|------------------------------------------------------| | wordCount | number | 3 | Number of words (or pass as first param directly) | | seed | string \| number | — | Deterministic PRNG seed for identical output | | secure | boolean | false | Uses Node/Web crypto.getRandomValues() | | alliteration | boolean | false | Forces all words to start with the same letter | | theme | WordTheme | "all" | Picks nouns matching scoped themes (e.g., "food") | | partsOfSpeech | WordCategory[] | ["adjective","adjective","noun"] | Order of word categories | | format | SlugFormat | "kebab" | Output format (see below) | | separator | string | — | Custom separator (overrides format separator) | | appendNumber | boolean | false | Append a random number 0–999 | | appendEmoji | boolean | false | Append a random emoji | | prependEmoji | boolean | false | Prepend a random emoji | | emojiCategory | EmojiCategory | "all" | Emoji set: "animals", "nature", "objects", "smileys", "all" | | customWords | Partial<Record<WordCategory, string[]>> | — | Replace built-in word lists | | maxLength | number | — | Trim slug to this many characters (emoji excluded) |


Themes & Alliteration

// Force all words to target the same starting letter
generateSlug(3, { alliteration: true });
// "swift-silent-shark"

// Confine generated nouns to a specific theme!
// Themes: "food" | "places" | "professions" | "tech" | "nature" | "animals" | "objects"
generateSlug(2, { theme: "food" });
// "sweet-pizza"

Secure & Deterministic Randoms

// Using a seed explicitly generates identically predictable output every single time!
generateSlug(3, { seed: "user-123" });
// "brave-copper-wallaby"
generateSlug(3, { seed: "user-123" });
// "brave-copper-wallaby"

// Using WebCrypto/Crypto globally secures random logic safely
generateSlug(3, { secure: true });
// "holographic-quantum-pulse"

Formats

generateSlug({ format: "kebab"  })  // "brave-golden-fox"   ← default
generateSlug({ format: "snake"  })  // "brave_golden_fox"
generateSlug({ format: "camel"  })  // "braveGoldenFox"
generateSlug({ format: "pascal" })  // "BraveGoldenFox"
generateSlug({ format: "title"  })  // "Brave Golden Fox"
generateSlug({ format: "upper"  })  // "BRAVE-GOLDEN-FOX"
generateSlug({ format: "dot"    })  // "brave.golden.fox"
generateSlug({ format: "path"   })  // "brave/golden/fox"

Numbers & Emoji

generateSlug({ appendNumber: true })
// "swift-cyan-wolf-384"

generateSlug({ appendEmoji: true })
// "swift-cyan-wolf 🐺"

generateSlug({ prependEmoji: true, emojiCategory: "animals" })
// "🦊 swift-cyan-wolf"

generateSlug({ appendEmoji: true, appendNumber: true })
// "swift-cyan-wolf-384 🐺"

Max Length

generateSlug({ maxLength: 12 })
// "brave-golden" (trimmed cleanly)

generateSlugs(count, options?)

Generate multiple unique slugs at once. It automatically increments the PRNG seed if configured.

import { generateSlugs } from "random-words-slugs";

generateSlugs(5)
// ["brave-golden-fox", "tiny-cyan-wolf", "bold-silver-hawk", ...]

generateSlugs(3, { format: "pascal", appendNumber: true })
// ["BraveGoldenFox42", "TinyCyanWolf7", "BoldSilverHawk199"]

countUniqueSlugs(options?)

Count how many unique slug combinations are possible.

import { countUniqueSlugs } from "random-words-slugs";

countUniqueSlugs()
// 831,744  (based on default word lists)

countUniqueSlugs({ wordCount: 2 })
// 5,152

countUniqueSlugs({ wordCount: 4 })
// e.g. 51,380,736

Word Categories

| Category | Example words | |-------------|----------------------------------------| | adjective | brave, golden, tiny, cyber, cosmic ... | | noun | fox, river, rocket, pixel, nebula ... | | verb | soars, glows, hunts, dances, pulses ... | | adverb | swiftly, boldly, silently, keenly ... |


License

MIT