md4x 0.0.7 → 0.0.9

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.
Binary file
Binary file
Binary file
package/lib/napi.mjs CHANGED
@@ -3,8 +3,19 @@ import { arch, platform } from "node:process";
3
3
 
4
4
  const require = createRequire(import.meta.url);
5
5
 
6
+ function isMusl() {
7
+ if (platform !== "linux") return false;
8
+ try {
9
+ // glibc sets glibcVersionRuntime; musl does not
10
+ return !process.report?.getReport?.()?.header?.glibcVersionRuntime;
11
+ } catch {
12
+ return false;
13
+ }
14
+ }
15
+
6
16
  function loadBinding() {
7
- return require(`../build/md4x.${platform}-${arch}.node`);
17
+ const suffix = isMusl() ? "-musl" : "";
18
+ return require(`../build/md4x.${platform}-${arch}${suffix}.node`);
8
19
  }
9
20
 
10
21
  const binding = loadBinding();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md4x",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": "pi0/md4x",