Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ljlm0402/packmate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Project Logo

PackMate

๐Ÿค– Your smart and friendly CLI assistant for dependency updates and cleanup

npm Info

npm Version npm Release Version npm Downloads npm Package License

github Stars github Forks github Contributors github Issues

ยท English ยท Korean


Packmate is a modern CLI tool for managing, updating, and cleaning up your Node.js project dependencies.

It supports npm, pnpm, and yarn. With an intuitive interactive UI and powerful performance optimizations, Packmate helps you keep your project healthy and up-to-dateโ€”faster and safer than ever.

๐Ÿค– Why Packmate?

  • โšก Performance: 6x faster with 3-level caching system (memory + disk + network)
  • ๐ŸŽฏ Accuracy: 90%+ unused package detection with dev tool intelligence
  • ๐Ÿ›ก๏ธ Safety: Smart fallback for package managers, unused packages excluded from updates
  • ๐ŸŽจ Clarity: Grouped UI sessions (Patch/Minor/Major) with color-coded updates
  • ๐Ÿ”ง Flexibility: Full configuration support via packmate.config.json
  • ๐ŸŒ Modern: Clean, professional English interface with intuitive workflows

๐Ÿš€ Features

Performance & Optimization

  • 3-Level Caching System: Memory โ†’ Disk (1hr TTL) โ†’ Network
    • First run: Standard speed
    • Second run: 6x faster with cached registry data
  • Parallel Processing: Multi-core CPU utilization for file scanning (2-4x faster)
  • Adaptive Concurrency: Dynamic request throttling based on CPU cores (8-16 concurrent)

Smart Detection

  • Enhanced Unused Detection (90%+ accuracy):
    • Dynamic import detection: import('module')
    • Conditional require detection: try-catch, if blocks
    • DevDependencies intelligence: Recognizes build tools, linters, type definitions
    • Cross-validation: precinct + depcheck for high confidence
  • Update Detection:
    • Grouped by Patch/Minor/Major with color coding
    • Unused packages automatically excluded from update suggestions
    • Semver-aware version comparison
  • Installation Detection: Finds declared but not installed packages

UI/UX Excellence

  • Grouped UI Sessions:
    • ๐Ÿ”น Patch Updates (Green): Bug fixes, safe to update
    • ๐Ÿ”ธ Minor Updates (Yellow): New features, backward compatible
    • ๐Ÿ”ถ Major Updates (Red): Breaking changes, requires review
    • ๐Ÿ—‘๏ธ Unused Packages: High/Medium confidence levels
    • ๐Ÿ“ฅ Not Installed: Missing declared dependencies
    • โœ… Up-to-date: Informational list (non-selectable)
  • Safety Features:
    • Confirmation prompt for major updates
    • Breaking change warnings
    • Clear action summaries
  • Visual Enhancements:
    • Color-coded version changes
    • Progress bars for long operations
    • Fixed console box alignment

Configuration & Flexibility

  • Smart Package Manager Detection:
    • Auto-detects from lock files (pnpm-lock.yaml, yarn.lock, package-lock.json)
    • Verifies installation status
    • Auto-fallback to available manager with helpful tips
  • Configurable Options:
    • Custom ignore patterns (glob support)
    • Analysis modes (conservative/moderate/aggressive)
    • UI customization (default selections, color schemes)
    • Cache settings (duration, location)

๐Ÿ’พ Installation

npm install -g packmate
# or
pnpm add -g packmate
# or
yarn global add packmate

You can also run it instantly with:

npx packmate

๐Ÿ“ Usage

From your project root, just run:

packmate

Typical Workflow Example:

โ”Œ  ๐Ÿ“ฆ Packmate: Dependency Updates & Cleanup
โ”‚
โ—‡  Info โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  Package Manager: npm  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ”‚
Progress |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 17/17 (100%)
โ—‡  โœ… Found 3 packages with available updates
โ—‡  โœ… Unused package analysis complete
โ—‡  โœ… Found 0 not installed packages

๐Ÿ“Š Analysis Results:
   Updates available: 3
   Unused:            1
   Not installed:     0
   Up-to-date:        13

๐Ÿ”ถ Major Updates (3)
   โš ๏ธ  Breaking changes possible - Review carefully
โ”‚
โ—‡  Select major updates (caution required):
โ”‚  โ—ผ globby  13.2.2 โ†’ 15.0.0  [MAJOR]
โ”‚  โ—ป p-retry  6.2.1 โ†’ 7.1.0  [MAJOR]
โ”‚  โ—ป precinct  10.0.1 โ†’ 12.2.0  [MAJOR]
โ”‚
โš ๏ธ  Proceed with 1 major update(s)? Breaking changes may be included.
โ”‚  Yes
โ”‚
๐Ÿ—‘๏ธ  Unused Packages (High Confidence: 1)
   Safe to remove
โ”‚
โ—‡  Select packages to remove:
โ”‚  none
โ”‚
โ—‡  Show already up-to-date packages (13)?
โ”‚  No
โ”‚
โ—‡  Actions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  ๐Ÿ“ Actions to execute:     โ”‚
โ”‚    - update: [email protected]  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ”‚
> npm install [email protected]
โœ”๏ธ  Package update completed: [email protected]

โœ… Complete:
   Updated:   1
   Removed:   0
   Installed: 0
โ”‚
โ””  Packmate complete! ๐ŸŽ‰

โš™๏ธ Requirements

  • Node.js v16 or later (recommended v18+)
  • Supports npm, yarn, and pnpm
  • Works on Mac, Linux, and Windows

๐Ÿ”‘ CLI Options

No extra options neededโ€”just run packmate in your project directory. All selections (update, remove, install) are interactive.

โš™๏ธ Configuration

Packmate supports configuration via packmate.config.json or the packmate field in your package.json.

Example packmate.config.json:

{
  "ignorePatterns": ["@types/*", "eslint-*"],
  "analysisMode": {
    "unused": "moderate",
    "devDeps": true
  },
  "ui": {
    "groupSessions": true,
    "colorScheme": "auto",
    "defaultChecked": {
      "updateAvailable": true,
      "unused": false,
      "notInstalled": true,
      "latest": false
    }
  },
  "detection": {
    "dynamicImport": true,
    "conditionalRequire": true,
    "ignoreUnused": [
      "eslint",
      "prettier",
      "jest",
      "webpack"
    ]
  }
}

Configuration Options:

  • ignorePatterns: Array of glob patterns to ignore packages (e.g., ["@types/*"])
  • analysisMode.unused: Detection mode - "conservative" | "moderate" | "aggressive"
  • analysisMode.devDeps: Whether to analyze devDependencies separately
  • ui.groupSessions: Enable grouped UI sessions (Patch/Minor/Major)
  • ui.defaultChecked: Default selection states for each package type
  • detection.dynamicImport: Enable dynamic import detection
  • detection.conditionalRequire: Enable conditional require detection
  • detection.ignoreUnused: List of packages to always ignore in unused detection

Cache Management

Packmate automatically caches registry responses for faster subsequent runs. Clear cache if needed:

# Windows
del /q %TEMP%\packmate-cache\*

# Linux/Mac
rm -rf /tmp/packmate-cache/*

Cache location:

  • Windows: C:\Users\<user>\AppData\Local\Temp\packmate-cache
  • Linux/Mac: /tmp/packmate-cache

๐Ÿค Contributing

Contributions are always welcome! Please feel free to open an issue or submit a pull request.

๐Ÿ’ณ License

MIT


Made with โค๏ธ by AGUMON ๐Ÿฆ–