styfle / packagephobia

⚖️ Find the cost of adding a new dependency to your project
https://packagephobia.com
MIT License
2.14k stars 45 forks source link

chore: add lru cache to improve perf #1026

Closed styfle closed 1 year ago

styfle commented 1 year ago

The npm registry can take 2 or more seconds to fetch a package manifest, such as https://registry.npmjs.org/next

So this PR adds lru-cache to avoid fetching packages that we already fetched in the past 5 min.

This is particularly useful, when clicking versions in the bar chart since the manifest should be in the lru cache already.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
packagephobia ✅ Ready (Inspect) Visit Preview Nov 30, 2023 11:29pm
socket-security[bot] commented 1 year ago

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
lru-cache 10.1.0 None +0 456 kB