polotno-node 2.10.1 → 2.10.3
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/dist/assets/index-DpnZbsrO.js +298 -0
- package/dist/index.html +1 -1
- package/instance.js +19 -1
- package/package.json +7 -8
- package/dist/assets/index-D56TTNQ-.js +0 -298
- package/video.js +0 -161
package/dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
</style>
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-DpnZbsrO.js"></script>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
package/instance.js
CHANGED
|
@@ -75,6 +75,8 @@ module.exports.jsonToBlob = async (page, json, attrs) => {
|
|
|
75
75
|
|
|
76
76
|
const busyPages = [];
|
|
77
77
|
|
|
78
|
+
const createdInstances = [];
|
|
79
|
+
|
|
78
80
|
module.exports.createInstance = async ({
|
|
79
81
|
key,
|
|
80
82
|
url,
|
|
@@ -272,8 +274,9 @@ module.exports.createInstance = async ({
|
|
|
272
274
|
return blob;
|
|
273
275
|
};
|
|
274
276
|
|
|
275
|
-
|
|
277
|
+
const instance = {
|
|
276
278
|
close: async () => {
|
|
279
|
+
createdInstances.splice(createdInstances.indexOf(instance), 1);
|
|
277
280
|
await browser.close();
|
|
278
281
|
},
|
|
279
282
|
firstPage,
|
|
@@ -288,4 +291,19 @@ module.exports.createInstance = async ({
|
|
|
288
291
|
jsonToGIFBase64,
|
|
289
292
|
createPage: async () => await module.exports.createPage(browser, visitPage),
|
|
290
293
|
};
|
|
294
|
+
|
|
295
|
+
createdInstances.push(instance);
|
|
296
|
+
return instance;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// Function to close all created instances in parallel
|
|
300
|
+
const closeAllInstances = async () => {
|
|
301
|
+
await Promise.all(createdInstances.map((instance) => instance.close()));
|
|
291
302
|
};
|
|
303
|
+
|
|
304
|
+
// Also handle other termination signals
|
|
305
|
+
['SIGINT', 'SIGTERM', 'SIGQUIT', 'exit', 'exit'].forEach((signal) => {
|
|
306
|
+
process.on(signal, () => {
|
|
307
|
+
closeAllInstances();
|
|
308
|
+
});
|
|
309
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polotno-node",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.3",
|
|
4
4
|
"description": "Polotno workflow from NodeJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,31 +12,30 @@
|
|
|
12
12
|
"dist",
|
|
13
13
|
"index.js",
|
|
14
14
|
"instance.js",
|
|
15
|
-
"video.js",
|
|
16
15
|
"video-parallel.js",
|
|
17
16
|
"README.md"
|
|
18
17
|
],
|
|
19
18
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"ava": "^6.1.3",
|
|
22
|
-
"axios": "^1.7.
|
|
21
|
+
"axios": "^1.7.7",
|
|
23
22
|
"canvas": "^2.11.2",
|
|
24
23
|
"dotenv": "^16.4.5",
|
|
25
24
|
"fluent-ffmpeg": "^2.1.3",
|
|
26
25
|
"gifencoder": "^2.0.1",
|
|
27
26
|
"pixelmatch": "^6.0.0",
|
|
28
27
|
"pngjs": "^7.0.0",
|
|
29
|
-
"polotno": "^2.
|
|
28
|
+
"polotno": "^2.13.0",
|
|
30
29
|
"react": "^18.3.1",
|
|
31
30
|
"react-dom": "^18.3.1",
|
|
32
|
-
"vite": "^5.3
|
|
31
|
+
"vite": "^5.4.3"
|
|
33
32
|
},
|
|
34
33
|
"author": "Anton Lavrenov",
|
|
35
34
|
"license": "MIT",
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@sparticuz/chromium": "
|
|
38
|
-
"puppeteer": "
|
|
39
|
-
"puppeteer-core": "
|
|
36
|
+
"@sparticuz/chromium": "127.0.0",
|
|
37
|
+
"puppeteer": "23.3.0",
|
|
38
|
+
"puppeteer-core": "23.3.0",
|
|
40
39
|
"tmp": "^0.2.3"
|
|
41
40
|
},
|
|
42
41
|
"bugs": {
|