@napi-rs/keyring
Advanced tools
+116
-98
@@ -85,3 +85,2 @@ // prettier-ignore | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
@@ -98,3 +97,2 @@ try { | ||
| } | ||
| } else { | ||
@@ -115,3 +113,2 @@ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) | ||
| } | ||
| } else if (process.arch === 'ia32') { | ||
@@ -128,3 +125,2 @@ try { | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -141,3 +137,2 @@ try { | ||
| } | ||
| } else { | ||
@@ -148,12 +143,11 @@ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) | ||
| try { | ||
| return require('./keyring.darwin-universal.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-darwin-universal') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return require('./keyring.darwin-universal.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-darwin-universal') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| if (process.arch === 'x64') { | ||
@@ -170,3 +164,2 @@ try { | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -183,3 +176,2 @@ try { | ||
| } | ||
| } else { | ||
@@ -200,3 +192,2 @@ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -213,3 +204,2 @@ try { | ||
| } | ||
| } else { | ||
@@ -222,67 +212,98 @@ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) | ||
| try { | ||
| return require('./keyring.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-x64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return require('./keyring.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-x64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./keyring.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./keyring.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-x64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-x64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./keyring.linux-arm64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return require('./keyring.linux-arm64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./keyring.linux-arm64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./keyring.linux-arm64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./keyring.linux-arm-musleabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./keyring.linux-arm-musleabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm-musleabihf') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./keyring.linux-arm-gnueabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm-gnueabihf') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm-musleabihf') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'riscv64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./keyring.linux-riscv64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-riscv64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./keyring.linux-arm-gnueabihf.node') | ||
| return require('./keyring.linux-riscv64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@napi-rs/keyring-linux-riscv64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| try { | ||
| return require('./keyring.linux-ppc64-gnu.node') | ||
| } catch (e) { | ||
@@ -292,12 +313,9 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@napi-rs/keyring-linux-arm-gnueabihf') | ||
| return require('@napi-rs/keyring-linux-ppc64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'riscv64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./keyring.linux-riscv64-musl.node') | ||
| } else if (process.arch === 's390x') { | ||
| try { | ||
| return require('./keyring.linux-s390x-gnu.node') | ||
| } catch (e) { | ||
@@ -307,10 +325,13 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@napi-rs/keyring-linux-riscv64-musl') | ||
| return require('@napi-rs/keyring-linux-s390x-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./keyring.linux-riscv64-gnu.node') | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'openharmony') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./keyring.linux-arm64-ohos.node') | ||
| } catch (e) { | ||
@@ -320,11 +341,9 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@napi-rs/keyring-linux-riscv64-gnu') | ||
| return require('@napi-rs/keyring-linux-arm64-ohos') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| } else if (process.arch === 'x64') { | ||
| try { | ||
| return require('./keyring.linux-ppc64-gnu.node') | ||
| return require('./keyring.linux-x64-ohos.node') | ||
| } catch (e) { | ||
@@ -334,10 +353,9 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@napi-rs/keyring-linux-ppc64-gnu') | ||
| return require('@napi-rs/keyring-linux-x64-ohos') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 's390x') { | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./keyring.linux-s390x-gnu.node') | ||
| return require('./keyring.linux-arm-ohos.node') | ||
| } catch (e) { | ||
@@ -347,9 +365,8 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@napi-rs/keyring-linux-s390x-gnu') | ||
| return require('@napi-rs/keyring-linux-arm-ohos') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) | ||
| loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) | ||
| } | ||
@@ -384,7 +401,8 @@ } else { | ||
| if (loadErrors.length > 0) { | ||
| // TODO Link to documentation with potential fixes | ||
| // - The package owner could build/publish bindings for this arch | ||
| // - The user may need to bundle the correct files | ||
| // - The user may need to re-install node_modules to get new packages | ||
| throw new Error('Failed to load native binding', { cause: loadErrors }) | ||
| throw new Error( | ||
| `Cannot find native binding. ` + | ||
| `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + | ||
| 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', | ||
| { cause: loadErrors } | ||
| ) | ||
| } | ||
@@ -391,0 +409,0 @@ throw new Error(`Failed to load native binding`) |
+22
-22
| { | ||
| "name": "@napi-rs/keyring", | ||
| "version": "1.1.8", | ||
| "version": "1.1.9", | ||
| "description": "https://github.com/hwchen/keyring-rs Node.js binding via https://napi.rs", | ||
@@ -60,13 +60,13 @@ "main": "index.js", | ||
| "devDependencies": { | ||
| "@napi-rs/cli": "^3.0.0-alpha.80", | ||
| "@oxc-node/core": "^0.0.27", | ||
| "@napi-rs/cli": "^3.0.3", | ||
| "@oxc-node/core": "^0.0.30", | ||
| "@taplo/cli": "^0.7.0", | ||
| "@types/node": "^22.15.3", | ||
| "ava": "^6.3.0", | ||
| "@types/node": "^24.1.0", | ||
| "ava": "^6.4.1", | ||
| "chalk": "^5.4.1", | ||
| "husky": "^9.1.7", | ||
| "lint-staged": "^16.0.0", | ||
| "npm-run-all2": "^8.0.1", | ||
| "oxlint": "^0.16.9", | ||
| "prettier": "^3.5.3", | ||
| "lint-staged": "^16.1.2", | ||
| "npm-run-all2": "^8.0.4", | ||
| "oxlint": "^1.8.0", | ||
| "prettier": "^3.6.2", | ||
| "typescript": "^5.8.3" | ||
@@ -106,3 +106,3 @@ }, | ||
| }, | ||
| "packageManager": "yarn@4.9.1", | ||
| "packageManager": "yarn@4.9.2", | ||
| "funding": { | ||
@@ -113,15 +113,15 @@ "type": "github", | ||
| "optionalDependencies": { | ||
| "@napi-rs/keyring-darwin-arm64": "1.1.8", | ||
| "@napi-rs/keyring-linux-arm64-gnu": "1.1.8", | ||
| "@napi-rs/keyring-linux-arm64-musl": "1.1.8", | ||
| "@napi-rs/keyring-win32-arm64-msvc": "1.1.8", | ||
| "@napi-rs/keyring-darwin-x64": "1.1.8", | ||
| "@napi-rs/keyring-win32-x64-msvc": "1.1.8", | ||
| "@napi-rs/keyring-linux-x64-gnu": "1.1.8", | ||
| "@napi-rs/keyring-linux-x64-musl": "1.1.8", | ||
| "@napi-rs/keyring-freebsd-x64": "1.1.8", | ||
| "@napi-rs/keyring-win32-ia32-msvc": "1.1.8", | ||
| "@napi-rs/keyring-linux-arm-gnueabihf": "1.1.8", | ||
| "@napi-rs/keyring-linux-riscv64-gnu": "1.1.8" | ||
| "@napi-rs/keyring-darwin-arm64": "1.1.9", | ||
| "@napi-rs/keyring-linux-arm64-gnu": "1.1.9", | ||
| "@napi-rs/keyring-linux-arm64-musl": "1.1.9", | ||
| "@napi-rs/keyring-win32-arm64-msvc": "1.1.9", | ||
| "@napi-rs/keyring-darwin-x64": "1.1.9", | ||
| "@napi-rs/keyring-win32-x64-msvc": "1.1.9", | ||
| "@napi-rs/keyring-linux-x64-gnu": "1.1.9", | ||
| "@napi-rs/keyring-linux-x64-musl": "1.1.9", | ||
| "@napi-rs/keyring-freebsd-x64": "1.1.9", | ||
| "@napi-rs/keyring-win32-ia32-msvc": "1.1.9", | ||
| "@napi-rs/keyring-linux-arm-gnueabihf": "1.1.9", | ||
| "@napi-rs/keyring-linux-riscv64-gnu": "1.1.9" | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
22758
5.03%573
7.1%8
14.29%