Expand description
Lightweight shell command parser for package.json scripts.
Extracts:
- Binary names → mapped to npm package names for dependency usage detection
--configarguments → file paths for entry point discovery- Positional file arguments → file paths for entry point discovery
Handles env var prefixes (cross-env, dotenv, KEY=value), package manager
runners (npx, pnpm exec, yarn dlx), and Node.js runners (node, tsx,
ts-node). Shell operators (&&, ||, ;, |, &) are split correctly.
Structs§
- Script
Analysis - Result of analyzing all package.json scripts.
- Script
Command - A parsed command segment from a script value.
Functions§
- analyze_
scripts - Analyze all scripts from a package.json
scriptsfield. - filter_
production_ scripts - Filter scripts to only production-relevant ones (start, build, and their pre/post hooks).
- parse_
script - Parse a single script value into one or more commands.
- resolve_
binary_ to_ package - Resolve a binary name to its npm package name.