pkgjson-cli
v1.0.0
Published
Inspect and query package.json files from the command line
Maintainers
Readme
pkgjson-cli
Inspect and query package.json files from the command line. A prettier, faster alternative to manually reading package.json or running npm outdated.
Install
npm install -g pkgjson-cliUsage
Pretty-print package.json
pkgjsonDisplays name, version, description, license, author, dependency counts, and script counts in a clean format.
List dependencies
pkgjson depsShows all dependencies (prod, dev, peer, optional) sorted alphabetically with version ranges.
List scripts
pkgjson scriptsShows all npm scripts defined in package.json.
Query npm registry
pkgjson info <package>Fetches and displays package info from the npm registry — latest version, license, homepage, maintainers, total versions.
Check outdated dependencies
pkgjson outdatedChecks all prod and dev dependencies against the npm registry. Color-coded by update severity:
- Red — major update
- Yellow — minor update
- Green — patch update
Estimate node_modules size
pkgjson sizeScans node_modules directory and reports total file count and disk usage.
Flags
| Flag | Description |
|------|-------------|
| --json | Output as JSON (works with all commands) |
| -d, --dir <path> | Target a different directory |
| -V, --version | Show version |
| -h, --help | Show help |
Examples
# JSON output for scripts
pkgjson --json scripts
# Check outdated in a specific project
pkgjson -d /path/to/project outdated
# Get registry info as JSON
pkgjson --json info reactLicense
MIT
