@resvg/resvg-js
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -1,1 +0,1 @@ | ||
const{existsSync,readFileSync}=require("fs"),{join}=require("path"),{platform,arch}=process;let nativeBinding=null,localFileExisted=!1,isMusl=!1,loadError=null;switch(platform){case"android":if(arch!=="arm64")throw new Error(`Unsupported architecture on Android ${arch}`);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"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=readFileSync("/usr/bin/ldd","utf8").includes("musl"),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=readFileSync("/usr/bin/ldd","utf8").includes("musl"),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{render,renderAsync}=nativeBinding;module.exports.render=render,module.exports.renderAsync=renderAsync; | ||
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{render,renderAsync}=nativeBinding;module.exports.render=render,module.exports.renderAsync=renderAsync; |
{ | ||
"name": "@resvg/resvg-js", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A high-performance SVG renderer, powered by Rust based resvg and napi-rs", | ||
@@ -68,4 +68,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@napi-rs/canvas": "^0.1.17", | ||
"@napi-rs/cli": "^2.2.0", | ||
"@napi-rs/canvas": "^0.1.19", | ||
"@napi-rs/cli": "^2.4.2", | ||
"@swc-node/register": "^1.4.2", | ||
@@ -79,4 +79,4 @@ "@types/node": "^17.0.1", | ||
"chalk": "^4.1.2", | ||
"esbuild": "^0.14.8", | ||
"eslint": "^8.5.0", | ||
"esbuild": "^0.14.11", | ||
"eslint": "^8.6.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
@@ -92,3 +92,3 @@ "eslint-plugin-import": "^2.25.3", | ||
"prettier": "^2.5.1", | ||
"sharp": "^0.29.2", | ||
"sharp": "^0.29.3", | ||
"svg2img": "^0.9.4", | ||
@@ -136,15 +136,15 @@ "typescript": "^4.5.4" | ||
"optionalDependencies": { | ||
"@resvg/resvg-js-win32-x64-msvc": "1.3.0", | ||
"@resvg/resvg-js-darwin-x64": "1.3.0", | ||
"@resvg/resvg-js-linux-x64-gnu": "1.3.0", | ||
"@resvg/resvg-js-linux-x64-musl": "1.3.0", | ||
"@resvg/resvg-js-linux-arm64-gnu": "1.3.0", | ||
"@resvg/resvg-js-win32-ia32-msvc": "1.3.0", | ||
"@resvg/resvg-js-linux-arm-gnueabihf": "1.3.0", | ||
"@resvg/resvg-js-darwin-arm64": "1.3.0", | ||
"@resvg/resvg-js-android-arm64": "1.3.0", | ||
"@resvg/resvg-js-android-arm-eabi": "1.3.0", | ||
"@resvg/resvg-js-linux-arm64-musl": "1.3.0", | ||
"@resvg/resvg-js-win32-arm64-msvc": "1.3.0" | ||
"@resvg/resvg-js-win32-x64-msvc": "1.4.0", | ||
"@resvg/resvg-js-darwin-x64": "1.4.0", | ||
"@resvg/resvg-js-linux-x64-gnu": "1.4.0", | ||
"@resvg/resvg-js-linux-x64-musl": "1.4.0", | ||
"@resvg/resvg-js-linux-arm64-gnu": "1.4.0", | ||
"@resvg/resvg-js-win32-ia32-msvc": "1.4.0", | ||
"@resvg/resvg-js-linux-arm-gnueabihf": "1.4.0", | ||
"@resvg/resvg-js-darwin-arm64": "1.4.0", | ||
"@resvg/resvg-js-android-arm64": "1.4.0", | ||
"@resvg/resvg-js-android-arm-eabi": "1.4.0", | ||
"@resvg/resvg-js-linux-arm64-musl": "1.4.0", | ||
"@resvg/resvg-js-win32-arm64-msvc": "1.4.0" | ||
} | ||
} |
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
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
33807
89