Menu

Post image 1
Post image 2
1 / 2
0

npm outdated won't tell you if a package is abandoned — so I built `stale-deps`

DEV Community·Mu Micro·21 days ago
#SKBxqCUG
#node#cli#devtools#opensource#packages#stale
Reading 0:00
15s threshold

The problem Developers often don't realize their project dependencies have been abandoned — npm outdated shows version lag but not how long ago a package was last published, leaving stale and potentially vulnerable packages silently lurking in codebases. As a solution, I created stale-deps Scan your package.json for packages that haven't been updated in a while — spot potentially abandoned npm packages instantly. Zero-dependency Node.js: npx stale-deps Enter fullscreen mode Exit fullscreen mode Output: Checking 12 packages (threshold: 365 days)... ⚠ 3 stale packages found: PACKAGE VERSION LAST UPDATED DAYS AGO node-uuid 1.4.8 2017-03-11 2982d (8y 1m) request 2.88.2 2020-02-14 1912d (5y 3m) colors 1.4.0 2021-01-16 1576d (4y 3m) ✓ 9 packages recently updated. Enter fullscreen mode Exit fullscreen mode How it works Hits the npm registry public JSON API for each dep, gets _npmPublishTime , computes age, outputs a sorted table. Batches 10 requests at a time. Zero dependencies.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More