resvg-napi 0.2.0 → 0.3.1

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/index.js CHANGED
@@ -1,4 +1,3 @@
1
- // prettier-ignore
2
1
  /* eslint-disable */
3
2
  // @ts-nocheck
4
3
  /* auto-generated by NAPI-RS */
@@ -63,7 +62,7 @@ const isMuslFromChildProcess = () => {
63
62
  function requireNative() {
64
63
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
65
64
  try {
66
- return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
65
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
67
66
  } catch (err) {
68
67
  loadErrors.push(err)
69
68
  }
@@ -77,8 +76,8 @@ function requireNative() {
77
76
  try {
78
77
  const binding = require('resvg-napi-android-arm64')
79
78
  const bindingPackageVersion = require('resvg-napi-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
79
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
80
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
81
  }
83
82
  return binding
84
83
  } catch (e) {
@@ -93,8 +92,8 @@ function requireNative() {
93
92
  try {
94
93
  const binding = require('resvg-napi-android-arm-eabi')
95
94
  const bindingPackageVersion = require('resvg-napi-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
95
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
96
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
97
  }
99
98
  return binding
100
99
  } catch (e) {
@@ -107,36 +106,36 @@ function requireNative() {
107
106
  if (process.arch === 'x64') {
108
107
  if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
109
108
  try {
110
- return require('./resvg-napi.win32-x64-gnu.node')
111
- } catch (e) {
112
- loadErrors.push(e)
113
- }
114
- try {
115
- const binding = require('resvg-napi-win32-x64-gnu')
116
- const bindingPackageVersion = require('resvg-napi-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
109
+ return require('./resvg-napi.win32-x64-gnu.node')
110
+ } catch (e) {
111
+ loadErrors.push(e)
112
+ }
113
+ try {
114
+ const binding = require('resvg-napi-win32-x64-gnu')
115
+ const bindingPackageVersion = require('resvg-napi-win32-x64-gnu/package.json').version
116
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
117
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
118
+ }
119
+ return binding
120
+ } catch (e) {
121
+ loadErrors.push(e)
119
122
  }
120
- return binding
121
- } catch (e) {
122
- loadErrors.push(e)
123
- }
124
123
  } else {
125
124
  try {
126
- return require('./resvg-napi.win32-x64-msvc.node')
127
- } catch (e) {
128
- loadErrors.push(e)
129
- }
130
- try {
131
- const binding = require('resvg-napi-win32-x64-msvc')
132
- const bindingPackageVersion = require('resvg-napi-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
125
+ return require('./resvg-napi.win32-x64-msvc.node')
126
+ } catch (e) {
127
+ loadErrors.push(e)
128
+ }
129
+ try {
130
+ const binding = require('resvg-napi-win32-x64-msvc')
131
+ const bindingPackageVersion = require('resvg-napi-win32-x64-msvc/package.json').version
132
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
133
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
134
+ }
135
+ return binding
136
+ } catch (e) {
137
+ loadErrors.push(e)
135
138
  }
136
- return binding
137
- } catch (e) {
138
- loadErrors.push(e)
139
- }
140
139
  }
141
140
  } else if (process.arch === 'ia32') {
142
141
  try {
@@ -147,8 +146,8 @@ function requireNative() {
147
146
  try {
148
147
  const binding = require('resvg-napi-win32-ia32-msvc')
149
148
  const bindingPackageVersion = require('resvg-napi-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
149
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
150
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
151
  }
153
152
  return binding
154
153
  } catch (e) {
@@ -163,8 +162,8 @@ function requireNative() {
163
162
  try {
164
163
  const binding = require('resvg-napi-win32-arm64-msvc')
165
164
  const bindingPackageVersion = require('resvg-napi-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
165
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
166
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
167
  }
169
168
  return binding
170
169
  } catch (e) {
@@ -182,8 +181,8 @@ function requireNative() {
182
181
  try {
183
182
  const binding = require('resvg-napi-darwin-universal')
184
183
  const bindingPackageVersion = require('resvg-napi-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
184
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
185
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
186
  }
188
187
  return binding
189
188
  } catch (e) {
@@ -198,8 +197,8 @@ function requireNative() {
198
197
  try {
199
198
  const binding = require('resvg-napi-darwin-x64')
200
199
  const bindingPackageVersion = require('resvg-napi-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
200
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
201
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
202
  }
204
203
  return binding
205
204
  } catch (e) {
@@ -214,8 +213,8 @@ function requireNative() {
214
213
  try {
215
214
  const binding = require('resvg-napi-darwin-arm64')
216
215
  const bindingPackageVersion = require('resvg-napi-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
216
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
217
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
218
  }
220
219
  return binding
221
220
  } catch (e) {
@@ -234,8 +233,8 @@ function requireNative() {
234
233
  try {
235
234
  const binding = require('resvg-napi-freebsd-x64')
236
235
  const bindingPackageVersion = require('resvg-napi-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
236
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
237
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
238
  }
240
239
  return binding
241
240
  } catch (e) {
@@ -250,8 +249,8 @@ function requireNative() {
250
249
  try {
251
250
  const binding = require('resvg-napi-freebsd-arm64')
252
251
  const bindingPackageVersion = require('resvg-napi-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
252
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
253
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
254
  }
256
255
  return binding
257
256
  } catch (e) {
@@ -271,8 +270,8 @@ function requireNative() {
271
270
  try {
272
271
  const binding = require('resvg-napi-linux-x64-musl')
273
272
  const bindingPackageVersion = require('resvg-napi-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
273
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
274
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
275
  }
277
276
  return binding
278
277
  } catch (e) {
@@ -287,8 +286,8 @@ function requireNative() {
287
286
  try {
288
287
  const binding = require('resvg-napi-linux-x64-gnu')
289
288
  const bindingPackageVersion = require('resvg-napi-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
289
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
290
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
291
  }
293
292
  return binding
294
293
  } catch (e) {
@@ -305,8 +304,8 @@ function requireNative() {
305
304
  try {
306
305
  const binding = require('resvg-napi-linux-arm64-musl')
307
306
  const bindingPackageVersion = require('resvg-napi-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
307
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
308
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
309
  }
311
310
  return binding
312
311
  } catch (e) {
@@ -321,8 +320,8 @@ function requireNative() {
321
320
  try {
322
321
  const binding = require('resvg-napi-linux-arm64-gnu')
323
322
  const bindingPackageVersion = require('resvg-napi-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
323
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
324
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
325
  }
327
326
  return binding
328
327
  } catch (e) {
@@ -339,8 +338,8 @@ function requireNative() {
339
338
  try {
340
339
  const binding = require('resvg-napi-linux-arm-musleabihf')
341
340
  const bindingPackageVersion = require('resvg-napi-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
341
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
342
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
343
  }
345
344
  return binding
346
345
  } catch (e) {
@@ -355,8 +354,8 @@ function requireNative() {
355
354
  try {
356
355
  const binding = require('resvg-napi-linux-arm-gnueabihf')
357
356
  const bindingPackageVersion = require('resvg-napi-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
357
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
358
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
359
  }
361
360
  return binding
362
361
  } catch (e) {
@@ -373,8 +372,8 @@ function requireNative() {
373
372
  try {
374
373
  const binding = require('resvg-napi-linux-loong64-musl')
375
374
  const bindingPackageVersion = require('resvg-napi-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
375
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
376
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
377
  }
379
378
  return binding
380
379
  } catch (e) {
@@ -389,8 +388,8 @@ function requireNative() {
389
388
  try {
390
389
  const binding = require('resvg-napi-linux-loong64-gnu')
391
390
  const bindingPackageVersion = require('resvg-napi-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
391
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
392
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
393
  }
395
394
  return binding
396
395
  } catch (e) {
@@ -407,8 +406,8 @@ function requireNative() {
407
406
  try {
408
407
  const binding = require('resvg-napi-linux-riscv64-musl')
409
408
  const bindingPackageVersion = require('resvg-napi-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
409
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
410
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
411
  }
413
412
  return binding
414
413
  } catch (e) {
@@ -423,8 +422,8 @@ function requireNative() {
423
422
  try {
424
423
  const binding = require('resvg-napi-linux-riscv64-gnu')
425
424
  const bindingPackageVersion = require('resvg-napi-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
425
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
426
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
427
  }
429
428
  return binding
430
429
  } catch (e) {
@@ -440,8 +439,8 @@ function requireNative() {
440
439
  try {
441
440
  const binding = require('resvg-napi-linux-ppc64-gnu')
442
441
  const bindingPackageVersion = require('resvg-napi-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
442
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
443
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
444
  }
446
445
  return binding
447
446
  } catch (e) {
@@ -456,8 +455,8 @@ function requireNative() {
456
455
  try {
457
456
  const binding = require('resvg-napi-linux-s390x-gnu')
458
457
  const bindingPackageVersion = require('resvg-napi-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
458
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
459
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
460
  }
462
461
  return binding
463
462
  } catch (e) {
@@ -476,8 +475,8 @@ function requireNative() {
476
475
  try {
477
476
  const binding = require('resvg-napi-openharmony-arm64')
478
477
  const bindingPackageVersion = require('resvg-napi-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
478
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
479
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
480
  }
482
481
  return binding
483
482
  } catch (e) {
@@ -492,8 +491,8 @@ function requireNative() {
492
491
  try {
493
492
  const binding = require('resvg-napi-openharmony-x64')
494
493
  const bindingPackageVersion = require('resvg-napi-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
494
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
495
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
496
  }
498
497
  return binding
499
498
  } catch (e) {
@@ -508,8 +507,8 @@ function requireNative() {
508
507
  try {
509
508
  const binding = require('resvg-napi-openharmony-arm')
510
509
  const bindingPackageVersion = require('resvg-napi-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
510
+ if (bindingPackageVersion !== '0.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
511
+ throw new Error(`Native binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
512
  }
514
513
  return binding
515
514
  } catch (e) {
@@ -550,7 +549,7 @@ function createLoadErrorChain(errors) {
550
549
  //
551
550
  // NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
552
551
  // WASI loading. It never crosses into another flavor or falls back to native.
553
- const __napiWasiFlavors = ["wasm32-wasi"]
552
+ const __napiWasiFlavors = ['wasm32-wasi']
554
553
  const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
555
554
  const __napiWasiFlavorRequested =
556
555
  typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
@@ -619,11 +618,11 @@ if (!nativeBinding || forceWasi) {
619
618
  }
620
619
  return null
621
620
  }
622
- if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
621
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
623
622
  let candidateError = null
624
623
  let candidateFailed = false
625
624
  try {
626
- candidateError = __napiWasiResolveCandidate('./resvg-napi.wasi.cjs', false, ["./resvg-napi.wasm32-wasi.debug.wasm","./resvg-napi.wasm32-wasi.wasm"])
625
+ candidateError = __napiWasiResolveCandidate('./resvg-napi.wasi.cjs', false, ['./resvg-napi.wasm32-wasi.debug.wasm', './resvg-napi.wasm32-wasi.wasm'])
627
626
  candidateFailed = candidateError !== null
628
627
  if (!candidateFailed) {
629
628
  wasiBinding = require('./resvg-napi.wasi.cjs')
@@ -639,7 +638,7 @@ if (!nativeBinding || forceWasi) {
639
638
  loadErrors.push(candidateError)
640
639
  }
641
640
  }
642
- if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
641
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
643
642
  let candidateError = null
644
643
  let candidateFailed = false
645
644
  try {
@@ -648,8 +647,8 @@ if (!nativeBinding || forceWasi) {
648
647
  if (!candidateFailed) {
649
648
  if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
650
649
  const bindingPackageVersion = require('resvg-napi-wasm32-wasi/package.json').version
651
- if (bindingPackageVersion !== '0.2.0') {
652
- throw new Error(`WASI binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
650
+ if (bindingPackageVersion !== '0.3.1') {
651
+ throw new Error(`WASI binding package version mismatch, expected 0.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
653
652
  }
654
653
  }
655
654
  wasiBinding = require('resvg-napi-wasm32-wasi')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "resvg-napi",
3
- "version": "0.2.0",
4
- "description": "Node bindings for resvg, generated from the upstream Rust sources: SVG to PNG, the usvg tree, fonts and text measurement.",
3
+ "version": "0.3.1",
4
+ "description": "Render SVG to PNG in Node — and read back the resolved tree, text metrics and fonts. Powered by resvg.",
5
5
  "keywords": [
6
6
  "svg",
7
7
  "png",
@@ -27,7 +27,9 @@
27
27
  "artifacts": "napi artifacts",
28
28
  "create-npm-dirs": "napi create-npm-dirs",
29
29
  "version": "napi version",
30
- "demo": "napi build --platform --release --target wasm32-wasip1-threads && cp resvg-napi.wasm32-wasi.wasm demo/ && esbuild resvg-napi.wasi-browser.js --bundle --format=esm --outfile=demo/resvg.js && esbuild wasi-worker-browser.mjs --bundle --format=esm --outfile=demo/wasi-worker-browser.mjs && esbuild demo/liquid-entry.mjs --bundle --format=esm --outfile=demo/liquid.js && node demo/serve.mjs",
30
+ "demo": "npm run demo:build && node demo/serve.mjs",
31
+ "demo:build": "npm run demo:wasm && node demo/build.mjs",
32
+ "demo:wasm": "napi build --platform --release --target wasm32-wasip1-threads",
31
33
  "check:pins": "node scripts/check-pins.mjs",
32
34
  "check:pins:selftest": "node scripts/check-pins.mjs --selftest",
33
35
  "check:package": "node scripts/check-package.mjs",
@@ -40,16 +42,18 @@
40
42
  "check:resvg": "node scripts/check-resvg.mjs",
41
43
  "check:resvg:selftest": "node scripts/check-resvg.mjs --selftest",
42
44
  "ci:targets": "node scripts/ci-targets.mjs",
43
- "ci:targets:selftest": "node scripts/ci-targets.mjs --selftest"
45
+ "ci:targets:selftest": "node scripts/ci-targets.mjs --selftest",
46
+ "licenses": "node scripts/licenses.mjs",
47
+ "licenses:selftest": "node scripts/licenses.mjs --selftest"
44
48
  },
45
49
  "types": "index.d.ts",
46
50
  "devDependencies": {
47
51
  "@fontsource/ibm-plex-sans": "^5.3.0",
48
52
  "@fontsource/space-mono": "^5.3.0",
49
- "@napi-rs/cli": "^3.8.6",
53
+ "@napi-rs/cli": "^3.9.1",
50
54
  "@types/node": "^26.2.0",
51
- "emnapi": "1.11.2",
52
- "esbuild": "^0.25.12",
55
+ "emnapi": "1.11.3",
56
+ "esbuild": "^0.28.2",
53
57
  "liquidjs": "^10.29.0",
54
58
  "pngjs": "^7.0.0",
55
59
  "qrcode-generator": "^2.0.4",
@@ -77,6 +81,7 @@
77
81
  "files": [
78
82
  "LICENSE-APACHE",
79
83
  "LICENSE-MIT",
84
+ "THIRD-PARTY-NOTICES.md",
80
85
  "README.md",
81
86
  "browser.js",
82
87
  "fit.d.mts",
@@ -103,22 +108,23 @@
103
108
  "url": "git+https://github.com/p8nut/resvg-napi.git"
104
109
  },
105
110
  "optionalDependencies": {
106
- "resvg-napi-linux-x64-gnu": "0.2.0",
107
- "resvg-napi-linux-arm64-gnu": "0.2.0",
108
- "resvg-napi-linux-arm-gnueabihf": "0.2.0",
109
- "resvg-napi-linux-x64-musl": "0.2.0",
110
- "resvg-napi-linux-arm64-musl": "0.2.0",
111
- "resvg-napi-darwin-arm64": "0.2.0",
112
- "resvg-napi-darwin-x64": "0.2.0",
113
- "resvg-napi-win32-x64-msvc": "0.2.0",
114
- "resvg-napi-win32-ia32-msvc": "0.2.0",
115
- "resvg-napi-win32-arm64-msvc": "0.2.0",
116
- "resvg-napi-android-arm64": "0.2.0",
117
- "resvg-napi-android-arm-eabi": "0.2.0"
111
+ "resvg-napi-linux-x64-gnu": "0.3.1",
112
+ "resvg-napi-linux-arm64-gnu": "0.3.1",
113
+ "resvg-napi-linux-arm-gnueabihf": "0.3.1",
114
+ "resvg-napi-linux-x64-musl": "0.3.1",
115
+ "resvg-napi-linux-arm64-musl": "0.3.1",
116
+ "resvg-napi-darwin-arm64": "0.3.1",
117
+ "resvg-napi-darwin-x64": "0.3.1",
118
+ "resvg-napi-win32-x64-msvc": "0.3.1",
119
+ "resvg-napi-win32-ia32-msvc": "0.3.1",
120
+ "resvg-napi-win32-arm64-msvc": "0.3.1",
121
+ "resvg-napi-android-arm64": "0.3.1",
122
+ "resvg-napi-android-arm-eabi": "0.3.1"
118
123
  },
119
124
  "dependencies": {
120
- "@emnapi/runtime": "1.11.2",
121
- "@napi-rs/wasm-runtime": "1.2.3"
125
+ "@emnapi/core": "1.11.3",
126
+ "@emnapi/runtime": "1.11.3",
127
+ "@napi-rs/wasm-runtime": "1.2.4"
122
128
  },
123
129
  "browser": "browser.js",
124
130
  "publishConfig": {
@@ -126,11 +132,11 @@
126
132
  "provenance": true
127
133
  },
128
134
  "peerDependencies": {
129
- "resvg-napi-wasm32-wasi": "0.2.0"
135
+ "resvg-napi-wasm32-wasi": "0.3.1"
130
136
  },
131
137
  "peerDependenciesMeta": {
132
138
  "resvg-napi-wasm32-wasi": {
133
139
  "optional": true
134
140
  }
135
141
  }
136
- }
142
+ }
@@ -51,11 +51,11 @@ let __emnapiWasmEnvCleanupDrained = false
51
51
  let __emnapiWasmEnvCleanupDrainPromise
52
52
  let __wasiDisposed = false
53
53
  let __wasiDisposePromise
54
- let __completeWasiDisposal = function() {}
54
+ let __completeWasiDisposal = function () {}
55
55
  // Overridden by loader flavors that have a last-resort reclaim for a rollback
56
56
  // that stopped short of destroying the context. See
57
57
  // `__rollbackWasiInitialization`.
58
- let __retainWasiRollbackForRetry = function() {}
58
+ let __retainWasiRollbackForRetry = function () {}
59
59
 
60
60
  function __isThenable(value) {
61
61
  return (
@@ -1,7 +1,5 @@
1
1
  // napi-rs-artifact-metadata:{"version":2,"rootEntry":"index.js","exports":["ClipPath","Filter","Font","FontDatabase","FontFace","Image","ImageKindGif","ImageKindJpeg","ImageKindPng","ImageKindWebp","LinearGradient","Mask","Pattern","PositionedGlyph","RadialGradient","Resvg","Span","SvgNode","Text","TextChunk","TextSpan","AlignmentBaseline","BlendMode","ColorChannel","ColorInterpolation","DominantBaseline","EdgeMode","FillRule","FontFaceStyle","FontOpticalSizing","FontStretch","FontStyle","ImageRendering","LengthAdjust","LineCap","LineJoin","MaskType","MorphologyOperator","NodeKind","PaintOrder","renderAsync","setLogLevel","ShapeRendering","SpreadMethod","takeLogs","TextAnchor","TextRendering","TurbulenceKind","WritingMode"],"managedRootEntries":["browser.js","index.js","resvg-napi.wasm","resvg-napi.debug.wasm"]}
2
2
  /* eslint-disable */
3
- /* prettier-ignore */
4
-
5
3
  /* auto-generated by NAPI-RS */
6
4
 
7
5
  const __nodeFs = require('node:fs')
@@ -91,6 +89,7 @@ function __createWasiWorker(filename) {
91
89
  return new Worker(filename, {
92
90
  env: process.env,
93
91
  execArgv: __workerExecArgv,
92
+ workerData: { hostRoot: __hostRoot, rootDir: __rootDir },
94
93
  })
95
94
  } catch (error) {
96
95
  if (!error || error.code !== 'ERR_WORKER_INVALID_EXEC_ARGV') {
@@ -106,14 +105,18 @@ function __createWasiWorker(filename) {
106
105
  }
107
106
  }
108
107
 
109
- const __rootDir = __nodePath.parse(process.cwd()).root
108
+ const __cwd = process.cwd()
109
+ const __rootDir = __nodePath.parse(__cwd).root
110
+ const __hostRoot =
111
+ process.platform === 'android' ? __cwd : __rootDir
110
112
 
111
113
  const __wasi = new __nodeWASI({
112
114
  version: 'preview1',
113
115
  env: process.env,
114
116
  preopens: {
115
- [__rootDir]: __rootDir,
116
- }
117
+ [__rootDir]: __hostRoot,
118
+ [__hostRoot]: __hostRoot,
119
+ },
117
120
  })
118
121
 
119
122
  const __sharedMemory = new WebAssembly.Memory({
@@ -155,11 +158,11 @@ let __emnapiWasmEnvCleanupDrained = false
155
158
  let __emnapiWasmEnvCleanupDrainPromise
156
159
  let __wasiDisposed = false
157
160
  let __wasiDisposePromise
158
- let __completeWasiDisposal = function() {}
161
+ let __completeWasiDisposal = function () {}
159
162
  // Overridden by loader flavors that have a last-resort reclaim for a rollback
160
163
  // that stopped short of destroying the context. See
161
164
  // `__rollbackWasiInitialization`.
162
- let __retainWasiRollbackForRetry = function() {}
165
+ let __retainWasiRollbackForRetry = function () {}
163
166
 
164
167
  function __isThenable(value) {
165
168
  return (
@@ -846,7 +849,7 @@ try {
846
849
  napiModule: __napiModule,
847
850
  } = __emnapiInstantiateNapiModuleSync(__wasmFile, {
848
851
  context: __emnapiContext,
849
- asyncWorkPoolSize: (function() {
852
+ asyncWorkPoolSize: (function () {
850
853
  const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE)
851
854
  // NaN > 0 is false
852
855
  if (threadsSizeFromEnv > 0) {
@@ -871,21 +874,21 @@ try {
871
874
  // According to https://github.com/nodejs/node/blob/19e0d472728c79d418b74bddff588bea70a403d0/lib/internal/worker.js#L415,
872
875
  // a worker is consist of two handles: kPublicPort and kHandle.
873
876
  {
874
- const kPublicPort = Object.getOwnPropertySymbols(worker).find(s =>
875
- s.toString().includes("kPublicPort")
876
- );
877
+ const kPublicPort = Object.getOwnPropertySymbols(worker).find((s) =>
878
+ s.toString().includes('kPublicPort'),
879
+ )
877
880
  if (kPublicPort) {
878
- worker[kPublicPort].ref = () => {};
881
+ worker[kPublicPort].ref = () => {}
879
882
  }
880
883
 
881
- const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
882
- s.toString().includes("kHandle")
883
- );
884
+ const kHandle = Object.getOwnPropertySymbols(worker).find((s) =>
885
+ s.toString().includes('kHandle'),
886
+ )
884
887
  if (kHandle) {
885
- worker[kHandle].ref = () => {};
888
+ worker[kHandle].ref = () => {}
886
889
  }
887
890
 
888
- worker.unref();
891
+ worker.unref()
889
892
  }
890
893
  return worker
891
894
  },