Lines 1-39javascript
3// `npx synsci`: the OpenScience install wizard.
5// The npm package (and this bin) keep the historical `synsci` name so the
6// one-liner everyone knows keeps working; everything it installs is the
7// OpenScience CLI (`@synsci/openscience`, binary `openscience`), optionally with the
8// Atlas managed platform on top.
10// Hard guard against recursive invocation. If a check ever resolves to the
11// launcher itself, this prevents an infinite spawn chain that exhausts memory.
12if (process.env.__SYNSCI_LAUNCHER_PID) {
14 `synsci: launcher invoked recursively (parent pid ${process.env.__SYNSCI_LAUNCHER_PID}). Exiting.\n`,
18process.env.__SYNSCI_LAUNCHER_PID = String(process.pid)
20import { execFileSync, execSync, spawn } from "node:child_process"
21import { existsSync, readFileSync, realpathSync } from "node:fs"
CriticalDownload Execute
Source downloads or fetches remote code and executes it.
bin/synsci.mjsView on unpkg · L11 CriticalTrigger Reachable Dangerous Capability
A package entrypoint or install-time lifecycle script reaches a source file with blocking dangerous behavior.
bin/synsci.mjsView on unpkg · L11 HighChild Process
Package source references child process execution.
bin/synsci.mjsView on unpkg · L19 22import { homedir } from "node:os"
23import { join } from "node:path"
24import { createInterface } from "node:readline"
25import { fileURLToPath } from "node:url"
27const SELF_PATH = (() => {
28 try { return realpathSync(fileURLToPath(import.meta.url)) } catch { return "" }
33const CYAN = "\x1b[36m"
34const GREEN = "\x1b[32m"
35const YELLOW = "\x1b[33m"
37const RESET = "\x1b[0m"
38const HIDE_CURSOR = "\x1b[?25l"
39const SHOW_CURSOR = "\x1b[?25h"