Skip to content

Commit bdb7dfa

Browse files
chore(NODE-6574): remove bindings as a production dependency (#42)
Co-authored-by: Neal Beeken <[email protected]>
1 parent 64b6b8f commit bdb7dfa

File tree

5 files changed

+13
-31
lines changed

5 files changed

+13
-31
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
!.eslintrc.json
22
!.mocharc.json
3-
!.prettierrc.json
3+
!.prettierrc.json
4+
!.release-please-manifest.json

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
".": "2.0.0-beta.0"
3-
}
3+
}

lib/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
'use strict';
2-
const zstd = require('bindings')('zstd');
32
const { promisify } = require('util');
43
const { isUint8Array } = require('util/types');
54

5+
function load() {
6+
try {
7+
return require('../build/Release/zstd.node');
8+
} catch {
9+
return require('../build/Debug/zstd.node');
10+
}
11+
}
12+
13+
const zstd = load();
14+
615
const _compress = promisify(zstd.compress);
716
const _decompress = promisify(zstd.decompress);
817
// Error objects created via napi don't have JS stacks; wrap them so .stack is present

package-lock.json

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"addon/*"
1111
],
1212
"dependencies": {
13-
"bindings": "^1.5.0",
1413
"node-addon-api": "^4.3.0",
1514
"prebuild-install": "^7.1.2"
1615
},

0 commit comments

Comments
 (0)