package-diet
v0.1.0
Published
Analyze your node_modules and suggest lighter, faster, or native alternatives to bloated dependencies.
Maintainers
Readme
package-diet 🥗
Analyze your
node_modulesand suggest lighter, faster, or native alternatives to bloated dependencies.
Install
npm install -g package-dietOr run without installing:
npx package-dietUsage
In any Node.js project folder:
package-dietOptions
| Flag | Description |
|---|---|
| --measure | Measure actual size on disk (slower) |
| --no-dev | Skip devDependencies |
| --json | Output as JSON |
| --cwd <path> | Project directory (default: current) |
| -h, --help | Show help |
Example output
🥗 package-diet report
Scanned 14 dependencies in /my-project
● moment ~4400 KB
Officially in maintenance mode. Large, mutable API.
Lighter alternatives:
→ date-fns (~600 KB)
→ dayjs (~30 KB)
→ luxon (~700 KB)
💡 Potential savings: ~4370 KBProgrammatic API
import { analyze } from "package-diet";
const result = await analyze({ cwd: "./my-project", measureSize: true });
console.log(result.findings);License
MIT
