pare-npm

v0.24.2
io.github.Dave-London/pare-npm Checked 3 hours ago Published 3 days ago

Pare npm ג€” Structured npm/pnpm operations (install, audit, outdated, list, run) as typed JSON.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

install Install Packages

Runs npm/pnpm/yarn install and returns available package counts and vulnerability information. Set pnpmReporter to 'silent' for quiet pnpm output; package statistics are omitted in this mode. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm). Lifecycle scripts (preinstall/postinstall) are skipped by default for safety. Set ignoreScripts to false if packages need postinstall scripts to work (e.g., esbuild, sharp).

ParameterTypeDescription
argsarrayAdditional arguments (e.g., package names to install)
dryRunbooleanPreview what would be installed without actually installing (maps to --dry-run)
exactbooleanSave exact versions instead of semver ranges (maps to --save-exact / -E)
filterstringpnpm workspace filter pattern (e.g., '@scope/pkg', './packages/foo'). Only used with pnpm.
forcebooleanForce reinstallation of all packages (maps to --force)
frozenLockfilebooleanFail if lockfile needs updating — for CI workflows (maps to --frozen-lockfile for pnpm/yarn, --ci for npm)
globalbooleanInstall packages globally (maps to --global / -g). Use with caution — may require elevated permissions.
ignoreScriptsbooleanSkip lifecycle scripts (preinstall/postinstall). Defaults to true for safety. Set to false if packages need postinstall scripts to run (e.g., esbuild, sharp).
legacyPeerDepsbooleanIgnore peer dependency conflicts (maps to --legacy-peer-deps, npm only)
noAuditbooleanSkip the automatic audit step to speed up installation. Only npm runs an audit during install, so this maps to --no-audit on npm. On pnpm and yarn it is a silent no-op (audit is a separate command, no…
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
pathstringProject root path
pnpmReporterstringpnpm-only reporter (maps to --reporter=silent). Omits package counts and other output-derived statistics. Rejected for npm/yarn.
productionbooleanInstall only production dependencies (maps to --omit=dev for npm, --prod for pnpm, --production for yarn)
registrystringRegistry URL to install from (maps to --registry, e.g., 'https://npm.pkg.github.com')
saveDevbooleanInstall as dev dependency (maps to --save-dev / -D)

audit Audit Dependencies

Runs npm/pnpm/yarn audit and returns structured vulnerability data. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).

ParameterTypeDescription
argsarrayEscape-hatch for PM-specific flags not modeled in the schema
fixbooleanWhen true, run `npm audit fix` (or `pnpm audit --fix`) to automatically fix vulnerabilities. Returns counts of fixed and remaining vulnerabilities.
levelstringMinimum severity level to report (maps to --audit-level for npm/pnpm)
omitarrayDependency groups to omit from the audit (maps to --omit for npm, e.g. ['dev', 'optional'])
packageLockOnlybooleanAudit from lockfile without requiring node_modules (maps to --package-lock-only for npm)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
pathstringProject root path
productionbooleanAudit only production (runtime) dependencies (maps to --production for npm, --prod for pnpm, --groups=dependencies for yarn)
workspacestringWorkspace to audit (maps to --workspace for npm)

outdated Outdated Packages

Checks for outdated packages and returns structured update information. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).

ParameterTypeDescription
allbooleanShow all nested outdated dependencies (maps to --all for npm)
argsarrayEscape-hatch for PM-specific flags not modeled in the schema
compatiblebooleanShow only semver-compatible updates (maps to --compatible for pnpm)
devOnlybooleanCheck only dev dependencies (maps to --dev for pnpm)
filterstringpnpm workspace filter pattern (e.g., '@scope/pkg', './packages/foo'). Only used with pnpm.
longbooleanShow extended info such as homepage and repository URLs (maps to --long for npm/pnpm)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
packagesarraySpecific package names to check for updates
pathstringProject root path
productionbooleanCheck only production dependencies (maps to --omit=dev for npm, --prod for pnpm)
workspacestringWorkspace to check (maps to --workspace for npm)

list List Packages

Lists installed packages as structured dependency data. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).

ParameterTypeDescription
allbooleanShow complete dependency tree (maps to --all for npm)
argsarrayEscape-hatch for PM-specific flags not modeled in the schema
compactbooleanPrefer compact output
depthnumberDependency tree depth (default: 0, top-level only)
filterstringpnpm workspace filter pattern (e.g., '@scope/pkg', './packages/foo'). Only used with pnpm.
globalbooleanList globally installed packages (maps to --global)
longbooleanShow extended info such as description and homepage (maps to --long)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
packagesarraySpecific package names to check if installed and at what version
pathstringProject root path
productionbooleanShow only production dependencies (maps to --omit=dev for npm, --prod for pnpm)
workspacestringWorkspace to list packages for (maps to --workspace for npm)

run Run Script

Runs a package.json script via `npm run <script>`, `pnpm run <script>`, or `yarn run <script>` and returns structured output with exit code, stdout, stderr, and duration. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).

ParameterTypeDescription
script *stringThe package.json script name to run
argsarrayAdditional arguments passed after -- to the script
filterstringpnpm workspace filter pattern (e.g., '@scope/pkg', './packages/foo'). Only used with pnpm.
ifPresentbooleanDon't error if the script is missing — useful in heterogeneous monorepos (maps to --if-present)
ignoreScriptsbooleanSkip pre/post lifecycle hooks (maps to --ignore-scripts)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
parallelbooleanRun workspace scripts in parallel (maps to --parallel for pnpm)
pathstringProject root path
recursivebooleanRun script in all workspace packages (maps to --recursive for pnpm, --workspaces for npm)
scriptShellstringOverride the shell used to run scripts (maps to --script-shell)
silentbooleanStrip npm/pnpm log chrome from output (maps to --silent)
streambooleanStream output with package name prefixes (maps to --stream for pnpm)
workspaceWorkspace target(s) — maps to npm --workspace or pnpm --filter for unified workspace targeting

test Run Tests

Runs `npm test`, `pnpm test`, or `yarn test` and returns structured output with exit code, stdout, stderr, and duration. Auto-detects package manager via lock files (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm). Shorthand for running the test script defined in package.json. Automatically parses test framework output (jest, vitest, mocha, tap) to extract pass/fail/skip counts.

ParameterTypeDescription
argsarrayAdditional arguments passed after -- to the test script
filterstringpnpm workspace filter pattern (e.g., '@scope/pkg', './packages/foo'). Only used with pnpm.
ifPresentbooleanDon't error if the test script is missing — useful in heterogeneous monorepos (maps to --if-present)
ignoreScriptsbooleanSkip pretest/posttest lifecycle hooks (maps to --ignore-scripts)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
parallelbooleanRun workspace tests in parallel (maps to --parallel for pnpm)
pathstringProject root path
recursivebooleanRun tests in all workspace packages (maps to --recursive for pnpm, --workspaces for npm)
silentbooleanStrip npm/pnpm log chrome for cleaner output (maps to --silent)
streambooleanStream output with package name prefixes (maps to --stream for pnpm)
workspaceWorkspace target(s) — maps to npm --workspace or pnpm --filter for unified workspace targeting

init Init Package

Initializes a new package.json in the target directory. Works with npm, pnpm, and yarn. Returns structured output with the package name, version, and path.

ParameterTypeDescription
authorEmailstringSet author email (maps to --init-author-email)
authorNamestringSet author name (maps to --init-author-name)
authorUrlstringSet author URL (maps to --init-author-url)
forcebooleanOverwrite existing package.json (maps to --force)
licensestringSet the license field at init time (maps to --init-license)
modulestringSet default module entry point (maps to --init-module)
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
pathstringDirectory to initialize
privatebooleanSet private: true in package.json (maps to yarn --private)
scopestringnpm scope for the package (e.g., '@myorg')
versionstringOverride default version '1.0.0' (maps to --init-version)
workspacestringCreate a workspace package (maps to npm --workspace)
yesbooleanUse -y flag for non-interactive init with defaults (default: true)

info Package Info

Shows detailed package metadata from the npm registry. Works with npm, pnpm, and yarn (all query the same registry).

ParameterTypeDescription
package *stringPackage name to look up (e.g. 'express', 'lodash@4.17.21')
compactbooleanPrefer compact output
fieldstringQuery a single field (e.g., 'engines', 'peerDependencies', 'versions')
packageManagerstringPackage manager to use. Auto-detected from lock files if not specified (pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm).
pathstringProject root path
registrystringRegistry URL to query (maps to --registry, e.g., 'https://npm.pkg.github.com')
workspacestringWorkspace for scoped queries (maps to --workspace for npm)

nvm Node Version Manager

Manages Node.js versions via nvm. Supports listing installed versions, showing the current version, listing remote versions, and executing commands with a specific Node.js version. Supports both Unix nvm and nvm-windows. SECURITY: The 'exec' action runs arbitrary commands under a specific Node version. Use PARE_NPM_ALLOWED_COMMANDS or PARE_ALLOWED_COMMANDS to restrict which commands can be executed.

ParameterTypeDescription
action *stringAction: 'list' shows installed versions, 'current' shows active version, 'ls-remote' lists available remote versions, 'exec' runs a command with a specific Node version, 'version' resolves a version a…
argsarrayArguments for the command in 'exec' action
commandstringCommand to run for 'exec' action (e.g., 'node', 'npm')
majorVersionsintegerFor 'ls-remote': limit to last N major Node.js versions (default: 4). Reduces output size significantly.
pathstringWorking directory for .nvmrc detection
versionstringNode.js version for 'exec' action (e.g., '20', '20.11.1', 'lts/iron')