The TypeScript module
wordsgenerates a list of words from a word, or a few letters. It's helpful for providing hints while playing games like Letterpress, Words with Friends, and Scrabble.
- Node.js 22+
- pnpm
pnpm add wordsimport { WordGenerator } from "words";
const wg = new WordGenerator();
await wg.generateTree();
const anagrams = wg.getAnagrams(["h", "e", "l", "l", "o"]);
console.log(anagrams);A demo version is available online:
curl https://httpip.es/api/words?letters=h,e,l,l,opnpm install # Install dependencies
pnpm type-check # Run TypeScript type checking
pnpm build # Compile TypeScript to dist/
pnpm test # Run tests
pnpm dev # Watch mode for TypeScript compilationAll comments in how to improve this library are very welcome. Feel free post suggestions to the Issue tracker, or even better, fork the repository to implement your own ideas and submit a pull request.
Unless attributed otherwise, everything is under the MIT License (see LICENSE for more info).
