7zip-native 0.0.5 → 0.0.7
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/README.md +47 -10
- package/bench/folder-concurrency.mts +143 -0
- package/dist/index.cjs +290 -15
- package/dist/index.d.cts +28 -2
- package/dist/index.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.mjs +285 -10
- package/native/addon.cpp +470 -0
- package/package.json +5 -2
- package/prebuilds/darwin-arm64/7zip_native.node +0 -0
- package/prebuilds/darwin-x64/7zip_native.node +0 -0
- package/prebuilds/linux-arm/7zip_native.node +0 -0
- package/prebuilds/linux-arm64/7zip_native.node +0 -0
- package/prebuilds/linux-ia32/7zip_native.node +0 -0
- package/prebuilds/linux-x64/7zip_native.node +0 -0
- package/prebuilds/win32-arm64/7z.dll +0 -0
- package/prebuilds/win32-arm64/7zip_native.node +0 -0
- package/prebuilds/win32-x64/7z.dll +0 -0
- package/prebuilds/win32-x64/7zip_native.node +0 -0
- package/scripts/build-native.mjs +119 -0
- package/scripts/clean-upstream-build.mjs +9 -0
- package/scripts/verify-prebuild.mjs +29 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {existsSync} from 'node:fs';
|
|
2
|
+
import {dirname, join} from 'node:path';
|
|
3
|
+
import {fileURLToPath} from 'node:url';
|
|
4
|
+
|
|
5
|
+
const packageDirectory = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const target = `${process.platform}-${process.arch}`;
|
|
7
|
+
const engineName = process.platform === 'win32'
|
|
8
|
+
? '7z.dll'
|
|
9
|
+
: process.platform === 'darwin' ? 'lib7z.dylib' : '7z.so';
|
|
10
|
+
const runtimeDirectories = [
|
|
11
|
+
join(packageDirectory, `../prebuilds/${target}`),
|
|
12
|
+
join(packageDirectory, '../build/Release'),
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
if(runtimeDirectories.some(directory =>
|
|
16
|
+
existsSync(join(directory, '7zip_native.node')) && existsSync(join(directory, engineName))))
|
|
17
|
+
{
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if(existsSync(join(packageDirectory, '../.git')))
|
|
22
|
+
{
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
throw new Error(
|
|
27
|
+
`No prebuilt 7zip-native binaries are available for ${target}. `
|
|
28
|
+
+ 'Check the supported platforms in the package README.',
|
|
29
|
+
);
|