Security auditing CLI tool that performs pre-installation checks on npm packages to detect vulnerabilities, malware, and supply chain risks before installation
npx @tessl/cli install tessl/npm-npq@3.16.0npq is a comprehensive security auditing CLI tool that performs pre-installation checks on npm packages before they are installed. It acts as a safety layer between package managers (npm, yarn, pnpm) and package installation by running multiple security and quality checks ("marshalls") to detect vulnerabilities, malware, typosquatting, deprecated packages, and supply chain risks.
npm install -g npq or brew install npq# Install globally
npm install -g npq
# Audit and install a package
npq install express
# Dry run (audit only)
npq install express --dry-runSee Quick Start Guide for detailed setup instructions.
npq uses a plugin-based "marshall" architecture with 14 security checks organized into three categories:
# Basic usage
npq install <package> [options]
# Options
--dry-run Run checks only, don't install
--plain Force non-rich text output
--packageManager Package manager to use (default: npm)
--disable-auto-continue Disable auto-continue countdown, always promptNPQ_PKG_MGR=yarn # Use yarn instead of npm
NPQ_DISABLE_AUTO_CONTINUE=true # Always prompt for confirmation
SNYK_TOKEN=your_token_here # Snyk API authentication
GITHUB_TOKEN=your_token_here # GitHub API token for deprecation checks
MARSHALL_DISABLE_AGE=1 # Disable specific marshallsSee Reference: Configuration for complete environment variable list.
| Marshall | Category | Error Conditions | Warning Conditions |
|---|---|---|---|
| age | PackageHealth | Package < 22 days old | Version > 365 days old |
| author | SupplyChainSecurity | First publish < 21 days, Version < 7 days | Version 7-30 days old |
| deprecation | PackageHealth | Deprecated, Repo archived | - |
| downloads | PackageHealth | < 100/month | 100-10000/month |
| expiredDomains | PackageHealth | Maintainer domain expired | - |
| license | SupplyChainSecurity | No license field | - |
| newBin | SupplyChainSecurity | - | New binary introduced |
| provenance | SupplyChainSecurity | - | No provenance attestations |
| repo | PackageHealth | No accessible repo/homepage | Repo/homepage inaccessible |
| scripts | MalwareDetection | Pre/post install scripts | - |
| signatures | SupplyChainSecurity | Invalid signature, Missing key | Expired key |
| snyk | SupplyChainSecurity | Vulnerabilities found, Malicious package | - |
| typosquatting | PackageHealth | Name similar to popular package | - |
| version-maturity | SupplyChainSecurity | Version < 7 days old | - |
See Reference: Security Marshalls for detailed documentation.
type ExitCode = 0 | 1 | -1;
// 0: Success (no errors, or user confirmed installation)
// 1: User aborted operation (Ctrl+C or explicit 'n' response)
// -1: Error occurred (package not found, validation failed, network error, etc.)const Marshall = require('npq/lib/marshall');
const marshall = new Marshall({
pkgs: ['express@latest'],
progressManager: null
});
const results = await marshall.run();
// Returns: Array of MarshallResult objectsSee Reference: API for complete programmatic usage documentation.
npq is built around a plugin-based "marshall" architecture:
npq and npq-hero): Entry points for interactive and automated usage