Skip to content

Commit 6553f79

Browse files
committed
Refactor index.js to require native module directly and export it, simplifying error handling.
1 parent f5cc6ec commit 6553f79

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
var native;
2-
try {
3-
native = require('./build/Release/hdiffpatch');
4-
} catch(e) {
5-
console.error(e);
6-
}
1+
const native = require('./build/Release/hdiffpatch');
2+
73
exports.native = native;
84

95
// 同步版本

0 commit comments

Comments
 (0)