Lines 1-30javascript
2import { createHash } from 'node:crypto';
3import { createWriteStream, existsSync } from 'node:fs';
4import { chmod, mkdir, readFile, rm } from 'node:fs/promises';
5import { dirname, join } from 'node:path';
6import { pipeline } from 'node:stream/promises';
7import { fileURLToPath } from 'node:url';
8import { execFileSync } from 'node:child_process';
9import { createRequire } from 'node:module';
11const require = createRequire(import.meta.url);
12const root = dirname(dirname(fileURLToPath(import.meta.url)));
MediumDynamic Require
Package source references dynamic require/import behavior.
scripts/install.jsView on unpkg · L10 13const pkg = require(join(root, 'package.json'));
15if (existsSync(join(root, '..', '..', 'pnpm-workspace.yaml'))) {
19const repo = process.env.INVOKER_RELEASE_REPOSITORY ?? 'Neko-Catpital-Labs/Invoker';
20const baseUrl = process.env.INVOKER_RELEASE_BASE_URL ?? `https://github.com/${repo}/releases/download/v${pkg.version}`;
21const asset = `invoker-cli-${pkg.version}-${process.platform}-${process.arch}.tar.gz`;
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
scripts/install.jsView on unpkg · L7 22const vendor = join(root, 'vendor');
23const archivePath = join(vendor, asset);
24const sumsPath = join(vendor, 'SHA256SUMS');
25const binaryPath = join(vendor, 'invoker-cli');
27if (!['darwin', 'linux'].includes(process.platform) || !['x64', 'arm64'].includes(process.arch)) {
28 throw new Error(`Unsupported Invoker CLI platform: ${process.platform}-${process.arch}`);