Skip to content

Commit

Permalink
chore(NODE-6574): remove bindings as a production dependency (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Neal Beeken <[email protected]>
  • Loading branch information
baileympearson and nbbeeken authored Nov 27, 2024
1 parent 64b6b8f commit bdb7dfa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!.eslintrc.json
!.mocharc.json
!.prettierrc.json
!.prettierrc.json
!.release-please-manifest.json
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.0.0-beta.0"
}
}
11 changes: 10 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
'use strict';
const zstd = require('bindings')('zstd');
const { promisify } = require('util');
const { isUint8Array } = require('util/types');

function load() {
try {
return require('../build/Release/zstd.node');
} catch {
return require('../build/Debug/zstd.node');
}
}

const zstd = load();

const _compress = promisify(zstd.compress);
const _decompress = promisify(zstd.decompress);
// Error objects created via napi don't have JS stacks; wrap them so .stack is present
Expand Down
27 changes: 0 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"addon/*"
],
"dependencies": {
"bindings": "^1.5.0",
"node-addon-api": "^4.3.0",
"prebuild-install": "^7.1.2"
},
Expand Down

0 comments on commit bdb7dfa

Please sign in to comment.