A lightweight TypeScript library that converts any number into consistent, memorable codename from a curated word list. It's designed for use cases where human-readability is more important than collision resistance, such as generating preview URLs or readable test IDs.
- 🎯 Deterministic - Same input always produces the same codename
- 💬 Human-Readable - Memorable names instead of random strings
- 🚀 Zero Dependencies - Lightweight and fast with no external packages
- ⚡ Fast & Tiny - 50,000+ generations per second, <3KB core + ~2KB per theme
- 🌐 Universal Runtime - Works in Node.js, Bun, Deno, browsers, and edge runtimes
- 🎨 Multiple Themes - Cities, animals, colors, space, and more built-in themes
- 🤖 CLI Included - Generate codenames directly from your terminal
Managing preview environments can get messy. You end up tracking which PR is deployed where, maintaining state, dealing with conflicts. Here's a simpler approach: use deterministic hashing to map PR numbers to memorable names.
With 20 city names, you get 20 deployment slots. No database needed. The same PR number always produces the same city name, so URLs stay consistent throughout the PR lifecycle.
Plus, it's easier to share "london.example.com" in Slack than "preview-env-1234.k8s.us-east-1.example.com".
- Docker Containers: docker run --name "app-${codename(buildId)}" myapp → app-tokyo
- Session IDs: vienna-support is friendlier than sess_kJ8Hg2Bx9
- Feature Flags: berlin-experiment instead of experiment_42
- Test Data: Generate predictable usernames (cat, dog, bird)
You can import specific themed word lists:
For maximum flexibility, use the core function with your own words:
- input - The number to convert
- words - Optional array of words to use (defaults to cities-20)
- input - The number to convert
- words - Required array of words to use
All APIs support the same input types:
- Positive integers: 123, 1234
- Negative integers: -42
- Decimals: 3.14 (converted to integers internally)
- Large numbers: up to Number.MAX_SAFE_INTEGER
Supported list sizes are 10, 20, 30, 50, and 100. The default theme uses 20 words.
Generate codenames directly from your terminal without writing any code.
For frequent use, install globally:
Each theme is available in multiple sizes: 10, 20, 30, 50, and 100 words. Choose based on your collision tolerance needs.
- Adjectives: good, bad, big, small, new, old, hot, cold, fast, slow, ...
- Animals: cat, dog, fish, bird, cow, pig, bee, ant, bat, fly, ...
- Cities: paris, london, rome, tokyo, berlin, madrid, sydney, moscow, cairo, dubai, ...
- Clothing: shirt, jeans, shoe, hat, sock, dress, coat, belt, tie, pants, ...
- Colors: red, blue, green, yellow, black, white, gray, pink, orange, purple, ...
- Countries: china, japan, india, france, italy, spain, canada, mexico, brazil, germany, ...
- Elements: gold, iron, lead, zinc, tin, copper, silver, carbon, oxygen, helium, ...
- Emotions: love, hate, joy, sad, fear, mad, happy, angry, glad, calm, ...
- Food: bread, milk, egg, rice, meat, fish, cake, apple, cheese, pasta, ...
- Gems: ruby, pearl, jade, opal, amber, diamond, emerald, gold, silver, topaz, ...
- Nature: tree, sun, sky, rain, moon, star, wind, sea, water, rock, ...
- Snacks: chips, nuts, cookie, pretzel, popcorn, candy, fruit, cheese, cracker, yogurt, ...
We welcome contributions! Here's how to get started:
Run /generate-words <name> AI prompt in Claude Code or a similar tool.
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass
- React Starter Kit — Modern React starter kit with Bun, TypeScript, tRPC, and Cloudflare Workers.
MIT License - see the LICENSE file for details.
.png)








