polotno-node
Advanced tools
Comparing version 2.7.3 to 2.8.0
{ | ||
"name": "polotno-node", | ||
"version": "2.7.3", | ||
"version": "2.8.0", | ||
"description": "Polotno workflow from NodeJS", | ||
@@ -22,4 +22,4 @@ "main": "index.js", | ||
"-": "^0.0.1", | ||
"ava": "^5.3.1", | ||
"axios": "^1.6.2", | ||
"ava": "^6.0.1", | ||
"axios": "^1.6.3", | ||
"canvas": "^2.11.2", | ||
@@ -31,6 +31,6 @@ "dotenv": "^16.3.1", | ||
"pngjs": "^7.0.0", | ||
"polotno": "^2.1.2", | ||
"polotno": "^2.4.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"vite": "^5.0.2" | ||
"vite": "^5.0.10" | ||
}, | ||
@@ -40,5 +40,5 @@ "author": "Anton Lavrenov", | ||
"dependencies": { | ||
"@sparticuz/chromium": "119.0.0", | ||
"puppeteer": "^21.5.2", | ||
"puppeteer-core": "^21.5.2", | ||
"@sparticuz/chromium": "119.0.2", | ||
"puppeteer": "^21.6.1", | ||
"puppeteer-core": "^21.6.1", | ||
"tmp": "^0.2.1" | ||
@@ -45,0 +45,0 @@ }, |
@@ -28,3 +28,2 @@ const fs = require('fs'); | ||
const convertToWebM = (input, output) => { | ||
console.log(input, output); | ||
return new Promise((resolve, reject) => { | ||
@@ -70,2 +69,10 @@ ffmpeg(input) | ||
const urlCache = {}; | ||
const cachedVideoToDataURL = async (url) => { | ||
if (!urlCache[url]) { | ||
urlCache[url] = videoToDataURL(url); | ||
} | ||
return urlCache[url]; | ||
}; | ||
function printProgress(progress) { | ||
@@ -84,6 +91,8 @@ process.stdout.clearLine(0); | ||
const videoEls = []; | ||
for (const page of json.pages) { | ||
for (const el of page.children) { | ||
if (el.type === 'video') { | ||
el.src = await videoToDataURL(el.src); | ||
videoEls.push(el); | ||
} | ||
@@ -93,2 +102,8 @@ } | ||
await Promise.all( | ||
videoEls.map(async (el) => { | ||
el.src = await cachedVideoToDataURL(el.src); | ||
}) | ||
); | ||
const duration = json.pages.reduce((acc, page) => { | ||
@@ -95,0 +110,0 @@ return acc + page.duration; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1187957
5269
+ Added@sparticuz/chromium@119.0.2(transitive)
- Removed@sparticuz/chromium@119.0.0(transitive)
Updated@sparticuz/chromium@119.0.2
Updatedpuppeteer@^21.6.1
Updatedpuppeteer-core@^21.6.1