@polaroid-vhs/npm-health
v0.1.0
Published
CLI tool to analyze npm package health before you install it
Downloads
97
Maintainers
Readme
npm-health
🏥 Check the health of an npm package before you install it
A simple CLI tool that analyzes npm packages and gives you a quick health score based on:
- How recently it was updated
- Number of dependencies
- License information
- Repository availability
Why?
Before adding a new dependency to your project, you should know:
- Is this package still maintained?
- Does it have too many dependencies?
- Is it licensed properly?
npm-health gives you this information in seconds.
Installation
npm install -g @polaroid-vhs/npm-healthUsage
npm-health <package-name>Example:
$ npm-health chalk
📦 Health Check: chalk
Latest version: 5.6.2
Last published: 157 days ago
Dependencies: 10
License: MIT
Repository: https://github.com/chalk/chalk
Health Score: 100/100
✅ Package looks healthy!Example with deprecated package:
$ npm-health request
📦 Health Check: request
Latest version: 2.88.2
Last published: 2193 days ago
Dependencies: 40
License: Apache-2.0
Repository: https://github.com/request/request
Health Score: 45/100
⚠️ Consider alternatives or check the package carefully before using.Health Score
The health score (0-100) is calculated based on:
- Last published (-40 if >2 years, -20 if >1 year)
- Dependencies (-30 if >50, -15 if >20)
- License (-10 if missing)
Scores:
- 80-100: Healthy package ✅
- 60-79: Use with caution
- <60: Consider alternatives ⚠️
API
You can also use it programmatically:
import { checkPackage } from '@polaroid-vhs/npm-health';
const health = await checkPackage('chalk');
console.log(health);
// {
// name: 'chalk',
// version: '5.6.2',
// daysSincePublish: 157,
// dependencies: 10,
// license: 'MIT',
// repository: 'https://github.com/chalk/chalk',
// description: 'Terminal string styling done right'
// }Development
# Install dependencies
npm install
# Run tests
npm test
# Test CLI locally
node src/cli.js <package-name>License
MIT © Polaroid
