english-lexicon
v0.0.2
Published
A comprehensive collection of 470,000+ English dictionary words aggregated from multiple public domain sources
Maintainers
Readme
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()andhasWord() - Efficient lookups - Uses
Setfor O(1) word existence checks - Zero runtime dependencies - Lightweight and fast
Installation
npm install english-lexiconUsage
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')); // falseAPI
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:
- dwyl/english-words - ~466k words
- lorenbrichter/Words - Letterpress game words
- sindresorhus/word-list - Curated word list
- first20hours/google-10000-english - Frequency-based lists
- MIT wordlists - 10k and 100k lists
- dolph/dictionary - Unix words
- en-wl/wordlist - SCOWL-based lists
- Wikipedia word frequency
- Moby Project
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
