Skip to content

timtjoe/word

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@timjoe/word

A fast, lightweight utility to generate structured sets of short English words based on specific consonant–vowel patterns. Ideal for creating naming options, extensions, or linguistic variations.

Warning

This library is designed strictly for naming and structural text generation. It is not intended for use as primary keys, secure IDs, or unique identifiers.

Usage

Import the Generator class and call generate() with your configuration:

import { Generator } from "@timjoe/word";

const gen = new Generator();
const result = gen.generate(2, "CV", 3);
console.log(result);

Return Schema

{
  "words": ["ba", "be", "bi"],
  "count": 3,
  "message": "Success"
}

Edge Cases & Fallbacks

Invalid lengths or patterns do not throw runtime errors. The generator gracefully defaults to a safe length (2) and pattern ("CV"), capping the maximum output to 13 results while providing notice in the message field.


Supported Patterns & Combinatorics

Total possible outputs are determined by the 21 consonants and 5 vowels available in the English alphabet.

2-Letter Words

  • CV (Consonant-Vowel) → 105 total variations
  • VC (Vowel-Consonant) → 105 total variations

3-Letter Words

  • CVC → 2,205 total variations
  • VCV / CVV / VVC → 525 variations each
  • CCV / VCC → 2,205 variations each

4-Letter Words

  • CVCV / VCVC → 11,025 variations each
  • CVVC / VCCV / CCVV → 2,205 variations each
  • VVCC → 525 total variations
  • CCVC / CVCC → 4,620 variations each

License

MIT © Timothy T. Joe

About

Library for generating 2, 3, and 4 letters english words.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors