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.
22 lines (21 loc) • 736 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.downloadHtml = void 0;
const follow_redirects_1 = require("follow-redirects");
const downloadHtml = (url) => {
return new Promise((resolve, reject) => {
const protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
protocol.get(url, (response) => {
let data = '';
response.setEncoding('utf8');
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
resolve(data);
});
response.on('error', reject);
});
});
};
exports.downloadHtml = downloadHtml;