We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69fd4b2 commit b3eae41Copy full SHA for b3eae41
1 file changed
index.js
@@ -1,4 +1,25 @@
1
-const native = require('node-gyp-build')(__dirname);
+function loadNative() {
2
+ const platform = process.platform;
3
+ const arch = process.arch;
4
+
5
+ if (platform === 'darwin' && arch === 'arm64') {
6
+ return require('./prebuilds/darwin-arm64/node-hdiffpatch.node');
7
+ }
8
+ if (platform === 'linux' && arch === 'x64') {
9
+ return require('./prebuilds/linux-x64/node-hdiffpatch.node');
10
11
+ if (platform === 'linux' && arch === 'arm64') {
12
+ return require('./prebuilds/linux-arm64/node-hdiffpatch.node');
13
14
15
+ const combo = `${platform}-${arch}`;
16
+ throw new Error(
17
+ `Unsupported platform/arch: ${combo}. ` +
18
+ 'No prebuilt binary is available for this platform.'
19
+ );
20
+}
21
22
+const native = loadNative();
23
24
exports.native = native;
25
0 commit comments