puppeteer-browser-ready 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! puppeteer-browser-ready v0.5.
|
|
1
|
+
//! puppeteer-browser-ready v0.5.2 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
|
|
2
2
|
|
|
3
3
|
/// <reference types="cheerio" />
|
|
4
4
|
import httpTerminator from 'http-terminator';
|
|
@@ -24,8 +24,8 @@ export declare type Web = {
|
|
|
24
24
|
response: HTTPResponse | null;
|
|
25
25
|
status: number | null;
|
|
26
26
|
location: Location;
|
|
27
|
-
title: string;
|
|
28
|
-
html: string;
|
|
27
|
+
title: string | null;
|
|
28
|
+
html: string | null;
|
|
29
29
|
$: cheerio.Root | null;
|
|
30
30
|
};
|
|
31
31
|
export declare type BrowserReadyOptions = {
|
|
@@ -34,9 +34,9 @@ export declare type BrowserReadyOptions = {
|
|
|
34
34
|
};
|
|
35
35
|
declare const browserReady: {
|
|
36
36
|
log(...args: unknown[]): void;
|
|
37
|
-
startWebServer(options?: StartWebServerOptions
|
|
37
|
+
startWebServer(options?: StartWebServerOptions): Promise<Http>;
|
|
38
38
|
shutdownWebServer(http: Http): Promise<void>;
|
|
39
|
-
goto(url: string, options?: BrowserReadyOptions
|
|
39
|
+
goto(url: string, options?: BrowserReadyOptions): (browser: Browser) => Promise<Web>;
|
|
40
40
|
close(web: Web): Promise<Web>;
|
|
41
41
|
};
|
|
42
42
|
export { browserReady };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! puppeteer-browser-ready v0.5.
|
|
1
|
+
//! puppeteer-browser-ready v0.5.2 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
|
|
2
2
|
|
|
3
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -62,7 +62,7 @@ const browserReady = {
|
|
|
62
62
|
const page = yield browser.newPage();
|
|
63
63
|
log('Page....', url);
|
|
64
64
|
const response = yield page.goto(url);
|
|
65
|
-
log('Response', response.url());
|
|
65
|
+
log('Response', response === null || response === void 0 ? void 0 : response.url());
|
|
66
66
|
const status = response && response.status();
|
|
67
67
|
log('Status', status);
|
|
68
68
|
const location = yield page.evaluate(() => globalThis.location);
|
|
@@ -70,7 +70,7 @@ const browserReady = {
|
|
|
70
70
|
const title = response && (yield page.title());
|
|
71
71
|
log('Title', title);
|
|
72
72
|
const html = response && (yield response.text());
|
|
73
|
-
log('Bytes', html.length);
|
|
73
|
+
log('Bytes', html === null || html === void 0 ? void 0 : html.length);
|
|
74
74
|
const $ = html && settings.addCheerio ? cheerio.load(html) : null;
|
|
75
75
|
log('$', $ && $['fn'].constructor.name);
|
|
76
76
|
return { browser, page, response, status, location, title, html, $ };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! puppeteer-browser-ready v0.5.
|
|
1
|
+
//! puppeteer-browser-ready v0.5.2 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
|
|
2
2
|
|
|
3
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -77,7 +77,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
77
77
|
const page = yield browser.newPage();
|
|
78
78
|
log('Page....', url);
|
|
79
79
|
const response = yield page.goto(url);
|
|
80
|
-
log('Response', response.url());
|
|
80
|
+
log('Response', response === null || response === void 0 ? void 0 : response.url());
|
|
81
81
|
const status = response && response.status();
|
|
82
82
|
log('Status', status);
|
|
83
83
|
const location = yield page.evaluate(() => globalThis.location);
|
|
@@ -85,7 +85,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
85
85
|
const title = response && (yield page.title());
|
|
86
86
|
log('Title', title);
|
|
87
87
|
const html = response && (yield response.text());
|
|
88
|
-
log('Bytes', html.length);
|
|
88
|
+
log('Bytes', html === null || html === void 0 ? void 0 : html.length);
|
|
89
89
|
const $ = html && settings.addCheerio ? cheerio_1.default.load(html) : null;
|
|
90
90
|
log('$', $ && $['fn'].constructor.name);
|
|
91
91
|
return { browser, page, response, status, location, title, html, $ };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "puppeteer-browser-ready",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Simple utility to go to a URL and wait for the HTTP response (written in TypeScript)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -88,19 +88,19 @@
|
|
|
88
88
|
"@types/cheerio": "~0.22",
|
|
89
89
|
"@types/express": "~4.17",
|
|
90
90
|
"@types/node": "~17.0",
|
|
91
|
-
"@typescript-eslint/eslint-plugin": "~5.
|
|
92
|
-
"@typescript-eslint/parser": "~5.
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "~5.27",
|
|
92
|
+
"@typescript-eslint/parser": "~5.27",
|
|
93
93
|
"add-dist-header": "~0.1",
|
|
94
94
|
"assert-deep-strict-equal": "~1.0",
|
|
95
95
|
"cpy-cli": "~4.1",
|
|
96
|
-
"eslint": "~8.
|
|
96
|
+
"eslint": "~8.16",
|
|
97
97
|
"jshint": "~2.13",
|
|
98
98
|
"mocha": "~10.0",
|
|
99
99
|
"npm-run-all2": "~5.0",
|
|
100
100
|
"open": "~8.4",
|
|
101
|
-
"puppeteer": "~14.
|
|
101
|
+
"puppeteer": "~14.2",
|
|
102
102
|
"rimraf": "~3.0",
|
|
103
|
-
"typescript": "~4.
|
|
103
|
+
"typescript": "~4.7",
|
|
104
104
|
"w3c-html-validator": "~1.0"
|
|
105
105
|
}
|
|
106
106
|
}
|