ata-validator 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +41 -23
- package/README.md +1 -1
- package/binding/ata_napi.cpp +32 -4
- package/index.js +53 -23
- package/lib/js-compiler.js +404 -34
- package/package.json +5 -3
- package/prebuilds/ata-darwin-arm64/node-napi-v10.node +0 -0
- package/scripts/install.js +23 -0
- package/src/ata.cpp +536 -147
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const root = path.resolve(__dirname, '..');
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
execSync('pkg-prebuilds-verify ./binding-options.js', { cwd: root, stdio: 'ignore' });
|
|
10
|
+
process.exit(0);
|
|
11
|
+
} catch {}
|
|
12
|
+
|
|
13
|
+
// No prebuild for this platform — try cmake-js if available
|
|
14
|
+
try {
|
|
15
|
+
execSync('cmake-js compile --target ata', { cwd: root, stdio: 'inherit' });
|
|
16
|
+
process.exit(0);
|
|
17
|
+
} catch {}
|
|
18
|
+
|
|
19
|
+
console.log(
|
|
20
|
+
'\n[ata-validator] No native prebuild found for ' + process.platform + '-' + process.arch + '.\n' +
|
|
21
|
+
'Falling back to JS engine (still works, ~2-3x slower for buffer APIs).\n' +
|
|
22
|
+
'To build from source: install cmake, RE2, abseil, then run `npx cmake-js compile --target ata`\n'
|
|
23
|
+
);
|