puppeteer-browser-ready 0.5.7 → 0.5.8

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.
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020-2022 individual contributors to puppeteer-browser-ready
3
+ Copyright (c) 2020-2023 Individual contributors to puppeteer-browser-ready
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -27,7 +27,7 @@ import { browserReady } from 'puppeteer-browser-ready';
27
27
 
28
28
  ## B) Usage
29
29
  Use the `browserReady.goto(url, options)` function to tell Puppeteer which page to open.
30
- The **Promise** will resolve with a **Web** object containing a `title` field and a `html` field.
30
+ The **Promise** will resolve with a **Web** object containing a `title` field and a `html` field.
31
31
  Pass the **Web** object to the `browserReady.close(web)` function to disconnect the page.
32
32
  ```javascript
33
33
  const url = 'https://pretty-print-json.js.org/';
@@ -50,8 +50,8 @@ after(async () => await browserReady.close(web));
50
50
  | `verbose` | **boolean** | `true` | Output informational messages. |
51
51
 
52
52
  ## C) TypeScript Declarations
53
- The **TypeScript Declaration File** file is
54
- [puppeteer-browser-ready.d.ts](dist/puppeteer-browser-ready.d.ts) in the **dist** folder.
53
+ See the TypeScript declarations at the top of the
54
+ [puppeteer-browser-ready.ts](puppeteer-browser-ready.ts) file.
55
55
 
56
56
  The `browserReady.goto(url, options)` function returns a function that takes a Puppeteer **Browser**
57
57
  object and returns a **Promise** that resolves with a **Web** object:
@@ -123,7 +123,7 @@ const url = 'https://pretty-print-json.js.org/';
123
123
  let web; //fields: browser, page, response, status, location, title, html, $
124
124
  const loadWebPage = async () =>
125
125
  web = await puppeteer.launch().then(browserReady.goto(url));
126
- const closeWebPage = async () =>
126
+ const closeWebPage = async () =>
127
127
  await browserReady.close(web);
128
128
 
129
129
  /////////////////////////////////////////////////////////////////////////////////////
@@ -1,17 +1,17 @@
1
- //! puppeteer-browser-ready v0.5.7 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
1
+ //! puppeteer-browser-ready v0.5.8 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
2
2
 
3
3
  /// <reference types="cheerio" />
4
4
  import { Browser, HTTPResponse, Page } from 'puppeteer';
5
5
  import { Server } from 'http';
6
6
  import httpTerminator from 'http-terminator';
7
- export declare type StartWebServerSettings = {
7
+ export type StartWebServerSettings = {
8
8
  folder: string;
9
9
  port: number;
10
10
  verbose: boolean;
11
11
  autoCleanup: boolean;
12
12
  };
13
- export declare type StartWebServerOptions = Partial<StartWebServerSettings>;
14
- export declare type Http = {
13
+ export type StartWebServerOptions = Partial<StartWebServerSettings>;
14
+ export type Http = {
15
15
  server: Server;
16
16
  terminator: httpTerminator.HttpTerminator;
17
17
  folder: string;
@@ -19,7 +19,7 @@ export declare type Http = {
19
19
  port: number;
20
20
  verbose: boolean;
21
21
  };
22
- export declare type Web = {
22
+ export type Web = {
23
23
  browser: Browser;
24
24
  page: Page;
25
25
  response: HTTPResponse | null;
@@ -29,11 +29,11 @@ export declare type Web = {
29
29
  html: string | null;
30
30
  $: cheerio.Root | null;
31
31
  };
32
- export declare type BrowserReadySettings = {
32
+ export type BrowserReadySettings = {
33
33
  addCheerio: boolean;
34
34
  verbose: boolean;
35
35
  };
36
- export declare type BrowserReadyOptions = Partial<BrowserReadySettings>;
36
+ export type BrowserReadyOptions = Partial<BrowserReadySettings>;
37
37
  declare const browserReady: {
38
38
  log(...args: unknown[]): void;
39
39
  startWebServer(options?: StartWebServerOptions): Promise<Http>;
@@ -1,4 +1,4 @@
1
- //! puppeteer-browser-ready v0.5.7 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
1
+ //! puppeteer-browser-ready v0.5.8 ~~ 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); }); }
@@ -1,4 +1,4 @@
1
- //! puppeteer-browser-ready v0.5.7 ~~ https://github.com/center-key/puppeteer-browser-ready ~~ MIT License
1
+ //! puppeteer-browser-ready v0.5.8 ~~ 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); }); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puppeteer-browser-ready",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
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",
@@ -64,16 +64,20 @@
64
64
  "@typescript-eslint/no-non-null-assertion": "off"
65
65
  }
66
66
  },
67
+ "runScriptsConfig": {
68
+ "build": [
69
+ "rimraf build dist **/.DS_Store",
70
+ "jshint . --exclude-path .gitignore",
71
+ "eslint --max-warnings 0 . --ext .ts",
72
+ "tsc",
73
+ "tsc --module UMD --outDir build/umd",
74
+ "copy-file build/umd/puppeteer-browser-ready.js build/puppeteer-browser-ready.umd.cjs",
75
+ "add-dist-header build dist",
76
+ "html-validator"
77
+ ]
78
+ },
67
79
  "scripts": {
68
- "step:01": "rimraf build dist **/.DS_Store",
69
- "step:02": "jshint . --exclude-path .gitignore",
70
- "step:03": "eslint --max-warnings 0 . --ext .ts",
71
- "step:10": "tsc",
72
- "step:11": "tsc --module UMD --outDir build/umd",
73
- "step:12": "copy-file build/umd/puppeteer-browser-ready.js build/puppeteer-browser-ready.umd.cjs",
74
- "step:20": "add-dist-header build dist",
75
- "step:30": "html-validator",
76
- "pretest": "npm-run-all step:*",
80
+ "pretest": "run-scripts build",
77
81
  "test": "mocha spec/*.spec.js --timeout 5000 --retries 1"
78
82
  },
79
83
  "peerDependencies": {
@@ -89,20 +93,20 @@
89
93
  "@types/express": "~4.17",
90
94
  "@types/node": "~18.11",
91
95
  "@types/ws": "~8.5",
92
- "@typescript-eslint/eslint-plugin": "~5.40",
93
- "@typescript-eslint/parser": "~5.40",
96
+ "@typescript-eslint/eslint-plugin": "~5.48",
97
+ "@typescript-eslint/parser": "~5.48",
94
98
  "add-dist-header": "~0.3",
95
99
  "assert-deep-strict-equal": "~1.0",
96
100
  "copy-file-util": "~0.1",
97
101
  "copy-folder-util": "~0.2",
98
- "eslint": "~8.25",
102
+ "eslint": "~8.32",
99
103
  "jshint": "~2.13",
100
- "mocha": "~10.0",
101
- "npm-run-all2": "~6.0",
104
+ "mocha": "~10.2",
102
105
  "open": "~8.4",
103
- "puppeteer": "~19.0",
104
- "rimraf": "~3.0",
105
- "typescript": "~4.8",
106
- "w3c-html-validator": "~1.2"
106
+ "puppeteer": "~19.5",
107
+ "rimraf": "~4.0",
108
+ "run-scripts-util": "~0.1",
109
+ "typescript": "~4.9",
110
+ "w3c-html-validator": "~1.3"
107
111
  }
108
112
  }