UNPKG

scrabble-solver

Version:

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

19 lines (16 loc) 507 B
import fs from 'fs'; import unzipper, { type Entry } from 'unzipper'; export const unzip = (zipFilename: string, extractFilename: string, outputFilename: string): Promise<void> => { return fs .createReadStream(zipFilename) .pipe(unzipper.Parse()) .on('entry', (entry: Entry) => { const fileName = entry.path; if (fileName === extractFilename) { entry.pipe(fs.createWriteStream(outputFilename)); } else { entry.autodrain(); } }) .promise(); };