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

@adamtools/apifinder

v1.0.3

Published

Finds all api endpoints of any nextjs project and adds them into README.md , makes api documentation easier

Readme

ApiFinder

Automatically discover and document Next.js API endpoints by analyzing your project's file structure. ApiFinder scans your Next.js project for API routes in both Pages Router and App Router patterns, extracts HTTP methods, and generates beautiful documentation.

CLI Usage

# Analyze current directory and update README.md
apifinder

# Analyze specific project path
apifinder --path /path/to/your/nextjs-project

# Output to custom file
apifinder --output API_DOCS.md

# Preview without updating files
apifinder --dry-run

# Get JSON output
apifinder --json

Programmatic Usage

const { ApiFinder } = require('apifinder');

async function analyzeProject() {
  const analyzer = new ApiFinder('./my-nextjs-project');
  const endpoints = await analyzer.analyze();
  
  console.log('Found endpoints:', endpoints);
  
  // Generate markdown table
  const markdownTable = analyzer.generateMarkdownTable();
  console.log(markdownTable);
  
  // Update README.md
  await analyzer.updateReadme();
}

analyzeProject();

Supported Patterns

Pages Router

  • pages/api/users.js → /api/users
  • pages/api/users/[id].js → /api/users/:id
  • pages/api/posts/[...slug].js → /api/posts/*slug
  • src/pages/api/auth/login.js → /api/auth/login

App Router

  • app/api/users/route.js → /api/users
  • app/api/users/[id]/route.js → /api/users/:id
  • app/api/posts/[...slug]/route.js → /api/posts/*slug
  • src/app/api/auth/login/route.js → /api/auth/login

Output Example

ApiFinder generates a table like this in your README:

| Route | Methods | File | Type | |----------------------|------------------|------------------------------------------|----------------| | /api/auth/login | POST | pages/api/auth/login.js | Pages Router | | /api/users | GET, POST | app/api/users/route.js | App Router | | /api/users/:id | GET, PUT, DELETE | app/api/users/[id]/route.js | App Router | | /api/posts/*slug | GET | pages/api/posts/[...slug].js | Pages Router |


Configuration

CLI Options

| Option | Description | Default | |------------------------|--------------------------------------------------|----------------| | -p, --path <path> | Path to Next.js project | Current directory | | -o, --output <file> | Output README file | README.md | | --dry-run | Show endpoints without updating README | false | | --json | Output endpoints as JSON | false |