@ogify/core 0.1.2 → 0.1.4

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/index.js CHANGED
@@ -344,13 +344,14 @@ async function renderTemplate(template, params, options) {
344
344
  });
345
345
  }
346
346
  });
347
- const pngData = await resvgJs.renderAsync(svg, {
347
+ const resvg = new resvgJs.Resvg(svg, {
348
348
  fitTo: {
349
349
  mode: "width",
350
350
  // Scale based on width, maintain aspect ratio
351
351
  value: width
352
352
  }
353
353
  });
354
+ const pngData = resvg.render();
354
355
  return Buffer.from(pngData.asPng());
355
356
  }
356
357
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import satori from 'satori';
2
2
  import { html } from 'satori-html';
3
- import { renderAsync } from '@resvg/resvg-js';
3
+ import { Resvg } from '@resvg/resvg-js';
4
4
 
5
5
  // src/template.ts
6
6
 
@@ -338,13 +338,14 @@ async function renderTemplate(template, params, options) {
338
338
  });
339
339
  }
340
340
  });
341
- const pngData = await renderAsync(svg, {
341
+ const resvg = new Resvg(svg, {
342
342
  fitTo: {
343
343
  mode: "width",
344
344
  // Scale based on width, maintain aspect ratio
345
345
  value: width
346
346
  }
347
347
  });
348
+ const pngData = resvg.render();
348
349
  return Buffer.from(pngData.asPng());
349
350
  }
350
351
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogify/core",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Core types and utilities for OGify Open Graph image generator",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -26,13 +26,27 @@
26
26
  "satori-html": "^0.3.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^18",
29
+ "@types/node": "^20",
30
30
  "@vitest/ui": "^4.0.15",
31
31
  "happy-dom": "^20.0.11",
32
32
  "tsup": "^8.5.1",
33
33
  "typescript": "^5.9.3",
34
34
  "vitest": "^4.0.15"
35
35
  },
36
+ "optionalDependencies": {
37
+ "@resvg/resvg-js-win32-x64-msvc": "^2.6.2",
38
+ "@resvg/resvg-js-darwin-x64": "^2.6.2",
39
+ "@resvg/resvg-js-linux-x64-gnu": "^2.6.2",
40
+ "@resvg/resvg-js-linux-x64-musl": "^2.6.2",
41
+ "@resvg/resvg-js-linux-arm64-gnu": "^2.6.2",
42
+ "@resvg/resvg-js-win32-ia32-msvc": "^2.6.2",
43
+ "@resvg/resvg-js-linux-arm-gnueabihf": "^2.6.2",
44
+ "@resvg/resvg-js-darwin-arm64": "^2.6.2",
45
+ "@resvg/resvg-js-android-arm64": "^2.6.2",
46
+ "@resvg/resvg-js-android-arm-eabi": "^2.6.2",
47
+ "@resvg/resvg-js-linux-arm64-musl": "^2.6.2",
48
+ "@resvg/resvg-js-win32-arm64-msvc": "^2.6.2"
49
+ },
36
50
  "scripts": {
37
51
  "build": "tsup",
38
52
  "dev": "tsup --watch",