UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

13 lines (10 loc) 421 B
import fs from 'fs'; import { downloadFile } from './downloadFile'; import { extractWords } from './extractWords'; export const getTxtWordList = async (url: string, locale: string): Promise<string[]> => { const tempFilename = await downloadFile(url); const file = fs.readFileSync(tempFilename, 'utf-8'); const words = extractWords(file.toLocaleString(), locale); fs.unlinkSync(tempFilename); return words; };