Codenames is a lightweight TypeScript library that transforms numbers into consistent, memorable codenames using a curated word list. With zero dependencies, fast performance, and the ability to generate recognizable names, it's an ideal tool for creating readable test IDs and preview URLs.
Codenames is a lightweight TypeScript library designed to transform any number into a memorable codename drawn from a curated list of words. It focuses on human-readable outputs instead of random strings, making it ideal for practical applications such as generating preview URLs or readable test identifiers.
Codenames can streamline many processes, such as:
https://${codename(1234)}.example.com producing a friendly london.example.com.app-${codename(buildId)} which results in more user-friendly identifiers like app-tokyo.vienna-support.To begin using Codenames, simply install the package and import it in your TypeScript project:
npm install codenames
Usage example:
import codename from "codenames";
const name = codename(1234); // Example output: "london"
Codenames supports multiple themed word lists or even custom word arrays, accommodating various needs:
import { codename } from "codenames/animals-20";
const name = codename(1234); // Example output: "cat"
For maximum flexibility, custom word lists can be used:
import { codename } from "codenames/core";
const name = codename(1234, ["alpha", "beta", "gamma"]); // Example output: "beta"
To use Codenames via the command line, simply run:
npx codenames 1234
This generates the codename based on the default theme.
Codenames presents an effective solution for anyone needing to convert numbers into memorable, human-readable names quickly and efficiently.
No comments yet.
Sign in to be the first to comment.