Skip to content

Commit 6fc5cac

Browse files
authored
⬆️ Upgrade dependencies (puppeteer@21.0.1 , handlebars@4.7.8) (#209)
* ⬆️ Make it compatible with node 18.17.0 * ⬆️ Upgrade handlebars to 4.7.8 * ⬆️ Upgrade puppeteer to 21.0.1 * ➖ Remove deprecated dev dependencies
1 parent a84a580 commit 6fc5cac

File tree

5 files changed

+380
-114
lines changed

5 files changed

+380
-114
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v1
1212
- uses: actions/setup-node@v1
1313
with:
14-
node-version: 16
14+
node-version: 18
1515
- run: yarn install --frozen-lockfile
1616
- run: yarn build
1717
- run: yarn lint

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"author": "FRIN Yvonnick <frin.yvonnick@gmail.com>",
99
"license": "Apache-2.0",
1010
"dependencies": {
11-
"handlebars": "^4.5.3",
12-
"puppeteer": "^15.3.0",
11+
"handlebars": "4.7.8",
12+
"puppeteer": "21.0.1",
1313
"puppeteer-cluster": "^0.23.0"
1414
},
1515
"scripts": {
@@ -28,8 +28,6 @@
2828
"@babel/preset-typescript": "^7.18.6",
2929
"@types/jest": "^28.1.4",
3030
"@types/node": "^16.11.43",
31-
"@types/puppeteer": "^5.4.6",
32-
"@types/puppeteer-core": "^5.4.0",
3331
"@typescript-eslint/eslint-plugin": "^5.30.4",
3432
"@typescript-eslint/parser": "^5.30.4",
3533
"eslint": "^8.19.0",
@@ -38,7 +36,7 @@
3836
"jest-circus": "^28.1.2",
3937
"puppeteer-core": "^15.3.0",
4038
"rimraf": "^3.0.2",
41-
"tesseract.js": "^2.1.5",
39+
"tesseract.js": "4.1.1",
4240
"typescript": "^4.7.4"
4341
}
4442
}

src/main.integration.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ describe("node-html-to-image", () => {
229229
});
230230

231231
async function getTextFromImage(path) {
232-
const worker = createWorker();
233-
await worker.load();
232+
const worker = await createWorker();
234233
await worker.loadLanguage("eng");
235234
await worker.initialize("eng");
236235

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function nodeHtmlToImage(options: Options) {
2323
concurrency: Cluster.CONCURRENCY_CONTEXT,
2424
maxConcurrency: 2,
2525
timeout,
26-
puppeteerOptions: { ...puppeteerArgs, headless: true },
26+
puppeteerOptions: { ...puppeteerArgs, headless: 'new' },
2727
puppeteer: puppeteer,
2828
});
2929

0 commit comments

Comments
 (0)