Skip to content

Commit

Permalink
ready for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
vdeturckheim committed May 30, 2023
1 parent 9fd1290 commit ff71f94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Binary file added addons/cld3-linux.node
Binary file not shown.
Binary file added addons/cld3-macos.node
Binary file not shown.
18 changes: 17 additions & 1 deletion index.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/***
* Copyright (c) 2023-2023 - All Rights Reserved
*/
const cld3 = require('bindings')('cld3.node');
const os = require('os');
const path = require('path');

let file = '';
switch (os.platform()) {
case 'darwin':
file = 'cld3-macos.node';
break;
case 'linux':
file = 'cld3-linux.node';
break;
}
if (!file) {
throw new Error('cld3 is not supported on this platform.');
}

const cld3 = require(path.join(__dirname, 'addons', file));

module.exports.getLanguage = cld3.getLanguage;

0 comments on commit ff71f94

Please sign in to comment.