1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
diff --git a/index.js b/index.js
index 64354f1..2a7eba3 100644
--- a/index.js
+++ b/index.js
@@ -98,6 +98,36 @@ switch (platform) {
throw new Error(`Unsupported architecture on Linux: ${arch}`);
}
break;
+ case 'freebsd':
+ switch (arch) {
+ case 'aarch64':
+ break;
+ localFileExisted = existsSync(join(__dirname, 'zstd.freebsd-arm64.node'));
+ try {
+ if (localFileExisted) {
+ nativeBinding = require('./zstd.freebsd-arm64.node');
+ } else {
+ nativeBinding = require('@mongodb-js/zstd-freebsd-arm64');
+ }
+ } catch (e) {
+ loadError = e;
+ }
+ case 'x64':
+ localFileExisted = existsSync(join(__dirname, 'zstd.freebsd-x64.node'));
+ try {
+ if (localFileExisted) {
+ nativeBinding = require('./zstd.freebsd-x64.node');
+ } else {
+ nativeBinding = require('@mongodb-js/zstd-freebsd-x64');
+ }
+ } catch (e) {
+ loadError = e;
+ }
+ break;
+ default:
+ throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
+ }
+ break;
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
}
diff --git a/npm/freebsd-arm64/README.md b/npm/freebsd-arm64/README.md
new file mode 100644
index 0000000..ccf9db8
--- /dev/null
+++ b/npm/freebsd-arm64/README.md
@@ -0,0 +1,3 @@
+# `@mongodb-js/zstd-freebsd-arm64`
+
+This is the **aarch64-unknown-freebsd** binary for `@mongodb-js/zstd`
diff --git a/npm/freebsd-arm64/README.md.orig b/npm/freebsd-arm64/README.md.orig
new file mode 100644
index 0000000..e69de29
diff --git a/npm/freebsd-arm64/package.json b/npm/freebsd-arm64/package.json
new file mode 100644
index 0000000..9ca4df6
--- /dev/null
+++ b/npm/freebsd-arm64/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "@mongodb-js/zstd-freebsd-arm64",
+ "version": "0.0.0",
+ "os": [
+ "freebsd"
+ ],
+ "cpu": [
+ "x64"
+ ],
+ "main": "zstd.freebsd-arm64.node",
+ "files": [
+ "zstd.freebsd-arm64.node"
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+}
diff --git a/npm/freebsd-arm64/package.json.orig b/npm/freebsd-arm64/package.json.orig
new file mode 100644
index 0000000..e69de29
diff --git a/npm/freebsd-x64/README.md b/npm/freebsd-x64/README.md
new file mode 100644
index 0000000..96bc2cf
--- /dev/null
+++ b/npm/freebsd-x64/README.md
@@ -0,0 +1,3 @@
+# `@mongodb-js/zstd-freebsd-x64`
+
+This is the **x86_64-unknown-freebsd** binary for `@mongodb-js/zstd`
diff --git a/npm/freebsd-x64/README.md.orig b/npm/freebsd-x64/README.md.orig
new file mode 100644
index 0000000..e69de29
diff --git a/npm/freebsd-x64/package.json b/npm/freebsd-x64/package.json
new file mode 100644
index 0000000..5556119
--- /dev/null
+++ b/npm/freebsd-x64/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "@mongodb-js/zstd-freebsd-x64",
+ "version": "0.0.0",
+ "os": [
+ "freebsd"
+ ],
+ "cpu": [
+ "x64"
+ ],
+ "main": "zstd.freebsd-x64.node",
+ "files": [
+ "zstd.freebsd-x64.node"
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+}
diff --git a/npm/freebsd-x64/package.json.orig b/npm/freebsd-x64/package.json.orig
new file mode 100644
index 0000000..e69de29
diff --git a/package.json b/package.json
index 16ddcfa..789a2a7 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,8 @@
"defaults": true,
"additional": [
"aarch64-apple-darwin",
- "aarch64-unknown-linux-gnu"
+ "aarch64-unknown-linux-gnu",
+ "aarch64-unknown-freebsd"
]
}
},
|