wreq-js 2.3.0 → 2.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/README.md CHANGED
@@ -55,7 +55,7 @@ bun add wreq-js
55
55
 
56
56
  Current configured native target matrix in `package.json` includes:
57
57
  1. macOS (Intel and Apple Silicon)
58
- 2. Linux (x64 glibc and musl, arm64 glibc)
58
+ 2. Linux (x64 glibc and musl, arm64 glibc and musl)
59
59
  3. Windows (x64)
60
60
 
61
61
  If a matching prebuilt artifact is unavailable for your environment, installation may build from source (requires a Rust toolchain).
package/dist/wreq-js.cjs CHANGED
@@ -91,13 +91,24 @@ function loadNativeBinding() {
91
91
  }
92
92
  }
93
93
  }
94
- if (platform === "linux" && arch === "arm64") try {
95
- return nativeRequire("../rust/wreq-js.linux-arm64-gnu.node");
96
- } catch {
94
+ if (platform === "linux" && arch === "arm64") {
95
+ if (libc === "musl") try {
96
+ return nativeRequire("../rust/wreq-js.linux-arm64-musl.node");
97
+ } catch {
98
+ try {
99
+ return nativeRequire("../rust/wreq-js.node");
100
+ } catch {
101
+ throw new Error("Failed to load native module for linux-arm64-musl. Tried: ../rust/wreq-js.linux-arm64-musl.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.");
102
+ }
103
+ }
97
104
  try {
98
- return nativeRequire("../rust/wreq-js.node");
105
+ return nativeRequire("../rust/wreq-js.linux-arm64-gnu.node");
99
106
  } catch {
100
- throw new Error("Failed to load native module for linux-arm64-gnu. Tried: ../rust/wreq-js.linux-arm64-gnu.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.");
107
+ try {
108
+ return nativeRequire("../rust/wreq-js.node");
109
+ } catch {
110
+ throw new Error("Failed to load native module for linux-arm64-gnu. Tried: ../rust/wreq-js.linux-arm64-gnu.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.");
111
+ }
101
112
  }
102
113
  }
103
114
  if (platform === "win32" && arch === "x64") try {
@@ -109,7 +120,7 @@ function loadNativeBinding() {
109
120
  throw new Error("Failed to load native module for win32-x64-msvc. Tried: ../rust/wreq-js.win32-x64-msvc.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.");
110
121
  }
111
122
  }
112
- throw new Error(`Unsupported platform: ${platform}-${arch}${libc ? `-${libc}` : ""}. Supported platforms: darwin-x64, darwin-arm64, linux-x64-gnu, linux-x64-musl, linux-arm64-gnu, win32-x64-msvc`);
123
+ throw new Error(`Unsupported platform: ${platform}-${arch}${libc ? `-${libc}` : ""}. Supported platforms: darwin-x64, darwin-arm64, linux-x64-gnu, linux-x64-musl, linux-arm64-gnu, linux-arm64-musl, win32-x64-msvc`);
113
124
  }
114
125
  nativeBinding = loadNativeBinding();
115
126
  const websocketFinalizer = typeof FinalizationRegistry === "function" ? new FinalizationRegistry((connection) => {