Skip to content

Instantly share code, notes, and snippets.

@iamjohnmills
Last active June 7, 2025 20:47
Show Gist options
  • Select an option

  • Save iamjohnmills/c7660db57e871f0933a67a2e5585960f to your computer and use it in GitHub Desktop.

Select an option

Save iamjohnmills/c7660db57e871f0933a67a2e5585960f to your computer and use it in GitHub Desktop.
Where to a free list of words

Gist Overview: Create a comprehensive list of English words.


On MacOS: Copy /usr/share/dict/words as words.txt

Free: https://www.gutenberg.org/ebooks/3201

The SINGLES.txt list here is comprehensive: https://www.gutenberg.org/files/3201/files/

(async () => {
  const fs = require('fs');
  const readline = require('readline');
  const words_source = 'Moby Word Lists by Grady Ward-SINGLE.txt';
  const file_stream = fs.createReadStream(words_source);
  const readline_interface = readline.createInterface({ input: file_stream, crlfDelay: Infinity });
  const dictionary_path = 'words.txt';
  if (fs.existsSync(dictionary_path)) fs.unlinkSync(dictionary_path);
  for await (const word of readline_interface) {
    const valid_length = word.length > 2; // remove 2-letter words
    const valid_case = /^[a-z]/.test(word); // remove proper names, places, and anything with non-word characters
    const is_valid = [valid_length,valid_case].every(rule => !!rule);
    if(!is_valid) continue;
    fs.appendFileSync(dictionary_path, `${word}\n`);
    console.log(word)
  }
  console.log('Finished...')
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment