npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

404-explorer

v0.1.0

Published

Ultra-light zero-config helper that turns your 404s into an interactive treasure map for real routes, recent misses, and smart suggestions.

Readme

404 Explorer(中文版)

English · 中文版本

一个零配置、超轻量的 404 调试助手。只需在 Express / Koa / Fastify 应用的末尾加上一行,就能把普通 404 页面变成“寻宝地图”,展示真实路由、最近踩空记录以及智能猜测。

核心特性

  • 自动列出项目已注册的路由
  • 基于 Levenshtein 距离的“猜你想去”提示
  • 记录最近的 404(次数 + 时间戳)
  • ?json 切换 JSON 模式,方便自动化
  • 通过 EXPLORER_404_COLOR 设置主题色

安装

npm i 404-explorer

使用方法

// Express、Koa、Fastify 等入口文件
require('404-explorer')(app)

访问不存在的地址(例如 http://localhost:3000/helo)即可看到极简 404 面板;追加 ?json 可查看同样信息的 JSON 版。

示例站点

项目自带 example/ 目录,可快速体验:

cd example
npm init -y
npm i express
node server.js

浏览器访问 http://localhost:3000/ 或任何不存在的路径,观察 404 Explorer 的交互。

可选参数

require('404-explorer')(app, {
  routes: ['/custom/list'], // 提供自定义路由列表,跳过自动发现
  router: appRouterInstance, // 传入自定义 router 以扫描路由
})

后续小升级灵感

  • 暴露 /~routes 接口,方便 CI 做死链扫描
  • 提供主题 / CSS 变量自定义
  • 导出 404 统计数据,接入监控面板

需要发布到 npm?请参考 PUBLISH.zh-CN.md。也欢迎 PR,一起保持它的“小而美” ✨