1.0.3 β’ Published 4 months ago
@sidharthsuresh1993/dep-impact v1.0.3
@sidharthsuresh1993/dep-impact π
A CLI tool to analyze the impact of npm dependencies on your project's performance.
Features
- π¦ Analyzes bundle size and gzip size
- π Checks for ESM support and tree-shaking capability
- π Shows transitive dependency count
- π‘ Suggests lighter alternatives
- π¨ Beautiful terminal output
- π JSON report export
- π Package comparison
- π GitHub Action integration
- π Bundle size trend analysis
Installation
# Install globally
npm install -g @sidharthsuresh1993/dep-impact
# Or use with npx
npx @sidharthsuresh1993/dep-impact
Usage
Analyze Project Dependencies
npx @sidharthsuresh1993/dep-impact analyze
Options:
-e, --export
: Export results to dep-impact-report.json-s, --size-limit <size>
: Set size limit for dependencies (in KB)-t, --trend
: Show bundle size trend for each dependency-f, --format <format>
: Output format (table, json, markdown)
Compare Packages
npx @sidharthsuresh1993/dep-impact compare moment dayjs
GitHub Action
Add this to your workflow file:
name: Dependency Size Check
on: [push, pull_request]
jobs:
check-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npx @sidharthsuresh1993/dep-impact analyze --size-limit 500
Output Example
ββββββββββββββββ¬ββββββββββ¬βββββββββββ¬ββββββββ¬βββββββββββββ¬ββββββ¬ββββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Package β Version β Bundle β Gzip β Last β ESM β Tree-Shakeableβ Dependenciesβ Alternativesβ
β β β Size β Size β Update β β β β β
ββββββββββββββββΌββββββββββΌβββββββββββΌββββββββΌβββββββββββββΌββββββΌββββββββββββββββΌββββββββββββββΌββββββββββββββ€
β lodash β 4.17.21 β 531.2 KB β 71 KB β 2021-04-02 β β β β β 0 β ramda, β
β β β β β β β β β underscore β
ββββββββββββββββ΄ββββββββββ΄βββββββββββ΄ββββββββ΄βββββββββββββ΄ββββββ΄ββββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Development
Setup
# Clone the repository
git clone https://github.com/sidharthsuresh1993/dep-impact.git
cd dep-impact
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT Β© Sidharth Suresh