Skip to content

Repository files navigation

english-lexicon

A comprehensive collection of English dictionary words aggregated from multiple public domain sources.

Features

  • 525,000+ unique English words - One of the largest collections available
  • Multiple sources - Aggregated from 16+ trusted word lists
  • Simple API - Just two methods: getWords() and hasWord()
  • Efficient lookups - Uses Set for O(1) word existence checks
  • Zero runtime dependencies - Lightweight and fast

Installation

npm install english-lexicon

Usage

import { EnglishLexicon } from 'english-lexicon';

// Get all words as an array
const words = EnglishLexicon.getWords();
console.log(`Total words: ${words.length}`);

// Check if a word exists
console.log(EnglishLexicon.hasWord('hello'));     // true
console.log(EnglishLexicon.hasWord('xyzzy123'));  // false

API

EnglishLexicon.getWords(): string[]

Returns an array of all words in the lexicon.

EnglishLexicon.hasWord(word: string): boolean

Checks if a word exists in the lexicon. Returns true if found, false otherwise.

Word Sources

The word list is aggregated from these public domain sources:

Use Cases

  • Spell checking - Validate if user input contains real words
  • Word games - Wordle, Scrabble, crossword puzzle solvers
  • Text analysis - Filter valid English words from text
  • Auto-completion - Suggest words based on prefix
  • Educational apps - Vocabulary building, word learning

License

MIT

About

A comprehensive collection of English dictionary words aggregated from multiple public domain sources.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages