-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinaries.mjs
More file actions
18 lines (15 loc) · 732 Bytes
/
binaries.mjs
File metadata and controls
18 lines (15 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import libc from 'detect-libc';
import * as abi from 'node-abi';
import os from 'os';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export function getModuleName() {
const stdlib = libc.familySync();
const platform = process.env['BUILD_PLATFORM'] || os.platform();
const arch = process.env['BUILD_ARCH'] || os.arch();
const identifier = [platform, arch, stdlib, abi.getAbi(process.versions.node, 'node')].filter(Boolean).join('-');
return `stack-trace-${identifier}.node`;
}
export const source = path.join(__dirname, '..', 'build', 'Release', 'stack-trace.node');
export const target = path.join(__dirname, '..', 'lib', getModuleName());