Skip to content

Commit 639cd3b

Browse files
committed
Release v1.3.0
1 parent e619fc7 commit 639cd3b

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

dist/puppeteer-browser-ready.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//! puppeteer-browser-ready v1.2.3 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
1+
//! puppeteer-browser-ready v1.3.0 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
22

3-
/// <reference types="cheerio" />
43
import { Browser, HTTPResponse, Page } from 'puppeteer';
54
import { HTMLElement } from 'node-html-parser';
65
import { Server } from 'http';
@@ -29,11 +28,9 @@ export type Web = {
2928
location: Location;
3029
title: string | null;
3130
html: string | null;
32-
$: cheerio.Root | null;
3331
root: HTMLElement | null;
3432
};
3533
export type BrowserReadySettings = {
36-
addCheerio: boolean;
3734
parseHtml: boolean;
3835
verbose: boolean;
3936
};

dist/puppeteer-browser-ready.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
//! puppeteer-browser-ready v1.2.3 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
1+
//! puppeteer-browser-ready v1.3.0 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
22

33
import { parse } from 'node-html-parser';
4-
import cheerio from 'cheerio';
54
import express from 'express';
65
import httpTerminator from 'http-terminator';
76
// Package
@@ -43,10 +42,8 @@ const browserReady = {
4342
return http.terminator.terminate();
4443
},
4544
goto(url, options) {
46-
const defaults = { addCheerio: false, parseHtml: true, verbose: false };
45+
const defaults = { parseHtml: true, verbose: false };
4746
const settings = { ...defaults, ...options };
48-
if (settings.addCheerio)
49-
console.log('puppeteer-browser-ready: Option "addCheerio" is deprecated, use "parseHtml" instead.');
5047
const log = (label, msg) => settings.verbose &&
5148
console.log(' ', Date.now() % 100000, label + ':', msg);
5249
const rootInfo = (root) => root.constructor.name + '/' + root.firstChild.toString();
@@ -65,10 +62,9 @@ const browserReady = {
6562
log('Title', title);
6663
const html = response && await response.text();
6764
log('Bytes', html?.length);
68-
const $ = html && settings.addCheerio ? cheerio.load(html) : null; //deprecated
6965
const root = html && settings.parseHtml ? parse(html) : null;
7066
log('DOM root', root ? rootInfo(root) : null);
71-
return { browser, page, response, status, location, title, html, $, root };
67+
return { browser, page, response, status, location, title, html, root };
7268
}
7369
catch (error) {
7470
const status = browser.isConnected() ? 'connected' : 'not connected';

hello-world/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"dependencies": {
1717
"jshint": "~2.13",
1818
"puppeteer": "~21.2",
19-
"puppeteer-browser-ready": "~1.2"
19+
"puppeteer-browser-ready": "~1.3"
2020
}
2121
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppeteer-browser-ready",
3-
"version": "1.2.3",
3+
"version": "1.3.0",
44
"description": "Simple utility to go to a URL and wait for the HTTP response",
55
"license": "MIT",
66
"type": "module",

0 commit comments

Comments
 (0)