bliss-rs/index.js

16 lines
471 B
JavaScript

let module;
try {
module = await import('./index.node');
} catch {
const isLinux = process.platform === 'linux';
if (isLinux && process.arch === 'x64') {
module = await import('./index-x86_64-unknown-linux-gnu.node');
} else if (isLinux && process.arch === 'arm64') {
module = await import('./index-aarch64-unknown-linux-gnu.node');
} else {
throw new Error('Bliss: unsupported architecture');
}
}
export const { analyze, analyzeSync } = module;