Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@resvg/resvg-js

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@resvg/resvg-js - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

2

js-binding.js

@@ -1,1 +0,1 @@

"use strict";const{existsSync,readFileSync}=require("fs"),{join}=require("path"),{platform,arch}=process;let nativeBinding=null,localFileExisted=!1,loadError=null;function isMusl(){if(!process.report||typeof process.report.getReport!="function")try{return readFileSync("/usr/bin/ldd","utf8").includes("musl")}catch(e){return!0}else{const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}}switch(platform){case"android":switch(arch){case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.android-arm64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.android-arm64.node"):nativeBinding=require("@resvg/resvg-js-android-arm64")}catch(e){loadError=e}break;case"arm":localFileExisted=existsSync(join(__dirname,"resvgjs.android-arm-eabi.node"));try{localFileExisted?nativeBinding=require("./resvgjs.android-arm-eabi.node"):nativeBinding=require("@resvg/resvg-js-android-arm-eabi")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Android ${arch}`)}break;case"win32":switch(arch){case"x64":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-x64-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-x64-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-x64-msvc")}catch(e){loadError=e}break;case"ia32":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-ia32-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-ia32-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-ia32-msvc")}catch(e){loadError=e}break;case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-arm64-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-arm64-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-arm64-msvc")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Windows: ${arch}`)}break;case"darwin":switch(arch){case"x64":localFileExisted=existsSync(join(__dirname,"resvgjs.darwin-x64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.darwin-x64.node"):nativeBinding=require("@resvg/resvg-js-darwin-x64")}catch(e){loadError=e}break;case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.darwin-arm64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.darwin-arm64.node"):nativeBinding=require("@resvg/resvg-js-darwin-arm64")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on macOS: ${arch}`)}break;case"freebsd":if(arch!=="x64")throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);localFileExisted=existsSync(join(__dirname,"resvgjs.freebsd-x64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.freebsd-x64.node"):nativeBinding=require("@resvg/resvg-js-freebsd-x64")}catch(e){loadError=e}break;case"linux":switch(arch){case"x64":if(isMusl()){localFileExisted=existsSync(join(__dirname,"resvgjs.linux-x64-musl.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-x64-musl.node"):nativeBinding=require("@resvg/resvg-js-linux-x64-musl")}catch(e){loadError=e}}else{localFileExisted=existsSync(join(__dirname,"resvgjs.linux-x64-gnu.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-x64-gnu.node"):nativeBinding=require("@resvg/resvg-js-linux-x64-gnu")}catch(e){loadError=e}}break;case"arm64":if(isMusl()){localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm64-musl.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm64-musl.node"):nativeBinding=require("@resvg/resvg-js-linux-arm64-musl")}catch(e){loadError=e}}else{localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm64-gnu.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm64-gnu.node"):nativeBinding=require("@resvg/resvg-js-linux-arm64-gnu")}catch(e){loadError=e}}break;case"arm":localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm-gnueabihf.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm-gnueabihf.node"):nativeBinding=require("@resvg/resvg-js-linux-arm-gnueabihf")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Linux: ${arch}`)}break;default:throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)}if(!nativeBinding)throw loadError||new Error("Failed to load native binding");const{BBox,Resvg,RenderedImage,renderAsync}=nativeBinding;module.exports.BBox=BBox,module.exports.Resvg=Resvg,module.exports.RenderedImage=RenderedImage,module.exports.renderAsync=renderAsync;
"use strict";const{existsSync,readFileSync}=require("fs"),{join}=require("path"),{platform,arch}=process;let nativeBinding=null,localFileExisted=!1,loadError=null;function isMusl(){if(!process.report||typeof process.report.getReport!="function")try{const e=require("child_process").execSync("which ldd").toString().trim();return readFileSync(e,"utf8").includes("musl")}catch(e){return!0}else{const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}}switch(platform){case"android":switch(arch){case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.android-arm64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.android-arm64.node"):nativeBinding=require("@resvg/resvg-js-android-arm64")}catch(e){loadError=e}break;case"arm":localFileExisted=existsSync(join(__dirname,"resvgjs.android-arm-eabi.node"));try{localFileExisted?nativeBinding=require("./resvgjs.android-arm-eabi.node"):nativeBinding=require("@resvg/resvg-js-android-arm-eabi")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Android ${arch}`)}break;case"win32":switch(arch){case"x64":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-x64-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-x64-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-x64-msvc")}catch(e){loadError=e}break;case"ia32":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-ia32-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-ia32-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-ia32-msvc")}catch(e){loadError=e}break;case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.win32-arm64-msvc.node"));try{localFileExisted?nativeBinding=require("./resvgjs.win32-arm64-msvc.node"):nativeBinding=require("@resvg/resvg-js-win32-arm64-msvc")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Windows: ${arch}`)}break;case"darwin":localFileExisted=existsSync(join(__dirname,"resvgjs.darwin-universal.node"));try{localFileExisted?nativeBinding=require("./resvgjs.darwin-universal.node"):nativeBinding=require("@resvg/resvg-js-darwin-universal");break}catch(e){}switch(arch){case"x64":localFileExisted=existsSync(join(__dirname,"resvgjs.darwin-x64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.darwin-x64.node"):nativeBinding=require("@resvg/resvg-js-darwin-x64")}catch(e){loadError=e}break;case"arm64":localFileExisted=existsSync(join(__dirname,"resvgjs.darwin-arm64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.darwin-arm64.node"):nativeBinding=require("@resvg/resvg-js-darwin-arm64")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on macOS: ${arch}`)}break;case"freebsd":if(arch!=="x64")throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);localFileExisted=existsSync(join(__dirname,"resvgjs.freebsd-x64.node"));try{localFileExisted?nativeBinding=require("./resvgjs.freebsd-x64.node"):nativeBinding=require("@resvg/resvg-js-freebsd-x64")}catch(e){loadError=e}break;case"linux":switch(arch){case"x64":if(isMusl()){localFileExisted=existsSync(join(__dirname,"resvgjs.linux-x64-musl.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-x64-musl.node"):nativeBinding=require("@resvg/resvg-js-linux-x64-musl")}catch(e){loadError=e}}else{localFileExisted=existsSync(join(__dirname,"resvgjs.linux-x64-gnu.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-x64-gnu.node"):nativeBinding=require("@resvg/resvg-js-linux-x64-gnu")}catch(e){loadError=e}}break;case"arm64":if(isMusl()){localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm64-musl.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm64-musl.node"):nativeBinding=require("@resvg/resvg-js-linux-arm64-musl")}catch(e){loadError=e}}else{localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm64-gnu.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm64-gnu.node"):nativeBinding=require("@resvg/resvg-js-linux-arm64-gnu")}catch(e){loadError=e}}break;case"arm":localFileExisted=existsSync(join(__dirname,"resvgjs.linux-arm-gnueabihf.node"));try{localFileExisted?nativeBinding=require("./resvgjs.linux-arm-gnueabihf.node"):nativeBinding=require("@resvg/resvg-js-linux-arm-gnueabihf")}catch(e){loadError=e}break;default:throw new Error(`Unsupported architecture on Linux: ${arch}`)}break;default:throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)}if(!nativeBinding)throw loadError||new Error("Failed to load native binding");const{BBox,Resvg,RenderedImage,renderAsync}=nativeBinding;module.exports.BBox=BBox,module.exports.Resvg=Resvg,module.exports.RenderedImage=RenderedImage,module.exports.renderAsync=renderAsync;
{
"name": "@resvg/resvg-js",
"version": "2.2.0",
"version": "2.3.0",
"description": "A high-performance SVG renderer and toolkit, powered by Rust based resvg and napi-rs",

@@ -77,3 +77,3 @@ "main": "index.js",

"@napi-rs/canvas": "^0.1.25",
"@napi-rs/cli": "^2.10.0",
"@napi-rs/cli": "^2.14.5",
"@swc-node/register": "^1.5.1",

@@ -84,7 +84,7 @@ "@types/node": "^18.0.0",

"@typescript-eslint/parser": "^5.30.3",
"ava": "^3.15.0",
"ava": "^5.0.0",
"benny": "^3.7.1",
"copyfiles": "^2.4.1",
"dts-bundle-generator": "^6.12.0",
"esbuild": "^0.15.0",
"esbuild": "^0.17.0",
"eslint": "^8.19.0",

@@ -94,3 +94,3 @@ "eslint-config-prettier": "^8.5.0",

"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-sonarjs": "^0.16.0",
"eslint-plugin-sonarjs": "^0.18.0",
"husky": "^7.0.4",

@@ -143,17 +143,17 @@ "jimp-compact": "^0.16.1-2",

},
"packageManager": "yarn@3.2.4",
"packageManager": "yarn@3.3.1",
"optionalDependencies": {
"@resvg/resvg-js-win32-x64-msvc": "2.2.0",
"@resvg/resvg-js-darwin-x64": "2.2.0",
"@resvg/resvg-js-linux-x64-gnu": "2.2.0",
"@resvg/resvg-js-linux-x64-musl": "2.2.0",
"@resvg/resvg-js-linux-arm64-gnu": "2.2.0",
"@resvg/resvg-js-win32-ia32-msvc": "2.2.0",
"@resvg/resvg-js-linux-arm-gnueabihf": "2.2.0",
"@resvg/resvg-js-darwin-arm64": "2.2.0",
"@resvg/resvg-js-android-arm64": "2.2.0",
"@resvg/resvg-js-android-arm-eabi": "2.2.0",
"@resvg/resvg-js-linux-arm64-musl": "2.2.0",
"@resvg/resvg-js-win32-arm64-msvc": "2.2.0"
"@resvg/resvg-js-win32-x64-msvc": "2.3.0",
"@resvg/resvg-js-darwin-x64": "2.3.0",
"@resvg/resvg-js-linux-x64-gnu": "2.3.0",
"@resvg/resvg-js-linux-x64-musl": "2.3.0",
"@resvg/resvg-js-linux-arm64-gnu": "2.3.0",
"@resvg/resvg-js-win32-ia32-msvc": "2.3.0",
"@resvg/resvg-js-linux-arm-gnueabihf": "2.3.0",
"@resvg/resvg-js-darwin-arm64": "2.3.0",
"@resvg/resvg-js-android-arm64": "2.3.0",
"@resvg/resvg-js-android-arm-eabi": "2.3.0",
"@resvg/resvg-js-linux-arm64-musl": "2.3.0",
"@resvg/resvg-js-win32-arm64-msvc": "2.3.0"
}
}

@@ -65,3 +65,2 @@ # resvg-js

| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img width="500" src="example/anime_girl.svg" alt="Anime girl SVG"><br/>[CC BY 3.0](https://creativecommons.org/licenses/by/3.0): [Niabot](https://commons.wikimedia.org/wiki/User:Niabot) | <img width="500" src="example/out-resvg-js.png" alt="Anime girl png" /><br/>[CC BY 3.0](https://creativecommons.org/licenses/by/3.0): [Niabot](https://commons.wikimedia.org/wiki/User:Niabot) |
| <img width="500" src="example/text.svg"> | <img width="500" src="example/text-out.png"> |

@@ -188,28 +187,16 @@

| | node12 | node14 | node16 | npm |
| ---------------- | ------ | ------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Windows x64 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-x64-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-x64-msvc) |
| |
| Windows x32 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-ia32-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-ia32-msvc) |
| |
| Windows arm64 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-arm64-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-arm64-msvc) |
| |
| macOS x64 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-darwin-x64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-darwin-x64) |
| |
| macOS arm64(M1) | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-darwin-arm64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-darwin-arm64) |
| |
| Linux x64 gnu | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-x64-gnu.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-x64-gnu) |
| |
| Linux x64 musl | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-x64-musl.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-x64-musl) |
| |
| Linux arm gnu | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm-gnueabihf.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm-gnueabihf) |
| |
| Linux arm64 gnu | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm64-gnu.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm64-gnu) |
| |
| Linux arm64 musl | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm64-musl.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm64-musl) |
| |
| Android arm64 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-android-arm64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-android-arm64) |
| |
| Android armv7 | ✓ | ✓ | ✓ | [![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-android-arm-eabi.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-android-arm-eabi) |
| |
| | Node.js 12 | Node.js 14 | Node.js 16 | Node.js 18 | npm |
| ---------------- | ---------- | ---------- | ---------- | ---------- | --- |
| Windows x64 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-x64-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-x64-msvc) |
| Windows x32 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-ia32-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-ia32-msvc) |
| Windows arm64 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-win32-arm64-msvc.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-win32-arm64-msvc) |
| macOS x64 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-darwin-x64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-darwin-x64) |
| macOS arm64(M1) | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-darwin-arm64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-darwin-arm64) |
| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-x64-gnu.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-x64-gnu) |
| Linux x64 musl | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-x64-musl.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-x64-musl) |
| Linux arm gnu | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm-gnueabihf.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm-gnueabihf) |
| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm64-gnu.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm64-gnu) |
| Linux arm64 musl | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-linux-arm64-musl.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-linux-arm64-musl) |
| Android arm64 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-android-arm64.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-android-arm64) |
| Android armv7 | ✓ | ✓ | ✓ | ✓ |[![npm version](https://img.shields.io/npm/v/@resvg/resvg-js-android-arm-eabi.svg?sanitize=true)](https://www.npmjs.com/package/@resvg/resvg-js-android-arm-eabi) |

@@ -216,0 +203,0 @@ ## Test or Contributing

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc