Lines 1-79javascript
4import { createInterface } from "readline";
5import { existsSync as existsSync4, writeFileSync as writeFileSync2, readFileSync as readFileSync2 } from "fs";
6import { join as join4 } from "path";
9import { existsSync } from "fs";
10import { join } from "path";
11var FRAMEWORK_CONFIG_PATTERNS = [
12 { framework: "nextjs", patterns: ["next.config.js", "next.config.mjs", "next.config.ts"] },
13 { framework: "nuxt", patterns: ["nuxt.config.js", "nuxt.config.mjs", "nuxt.config.ts"] },
14 { framework: "svelte", patterns: ["svelte.config.js", "svelte.config.mjs", "svelte.config.ts"] },
15 { framework: "astro", patterns: ["astro.config.js", "astro.config.mjs", "astro.config.ts", "astro.config.cjs"] }
17function detectFramework(cwd = process.cwd()) {
18 for (const { framework, patterns } of FRAMEWORK_CONFIG_PATTERNS) {
19 for (const p of patterns) {
20 if (existsSync(join(cwd, p))) return framework;
23 if (!existsSync(join(cwd, "package.json")) && existsSync(join(cwd, "index.html"))) {
26 if (existsSync(join(cwd, "package.json"))) return "unknown";
29function frameworkLabel(fw) {
47import { spawn } from "child_process";
48function openBrowser(url) {
49 const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
50 spawn(cmd, [url], { stdio: "ignore", detached: true }).unref();
54import { readFileSync, writeFileSync, existsSync as existsSync3 } from "fs";
55import { join as join3 } from "path";
58import { existsSync as existsSync2 } from "fs";
59import { join as join2 } from "path";
60import { execSync } from "child_process";
61function detectPackageManager(cwd = process.cwd()) {
62 if (existsSync2(join2(cwd, "pnpm-lock.yaml"))) return "pnpm";
63 if (existsSync2(join2(cwd, "yarn.lock"))) return "yarn";
64 if (existsSync2(join2(cwd, "bun.lockb")) || existsSync2(join2(cwd, "bun.lock"))) return "bun";
67function installPackage(pkg, pm, cwd = process.cwd()) {
68 const cmd = pm === "npm" ? `npm install ${pkg}` : `${pm} add ${pkg}`;
69 execSync(cmd, { cwd, stdio: "inherit" });
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/cli.jsView on unpkg · L59 73var HOSTED_SNIPPET = (trackingId) => `<script
74 defer
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
dist/cli.jsView on unpkg · L16 75 src="https://www.antlytics.com/tracker.js"
76 data-tracking-id="${trackingId}"
77 data-api-host="https://www.antlytics.com"
79async function installForFramework(framework, trackingId, cwd = process.cwd()) {