Registry / devops / next-to-fetch

next-to-fetch

JSON →
library0.6.0jsnpmunverified

CLI tool to analyze Next.js App Router projects and generate static fetch() API route definitions. Version 0.6.0, updated monthly. Differentiates from other route analyzers by focusing specifically on App Router routes, detecting client vs server context, duplicate routes, unsupported dynamic fetches, and cache signals. Outputs JSON or TypeScript files for type-safe API consumption.

npm install next-to-fetch
INSTALL
IMPORT
SIG · NEXT-TO-FETCH
N
next-to-fetch
devopsjavascriptv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (CLI)
npx next-to-fetch
require('next-to-fetch')
This package is a CLI tool, not a library. Use npx or install globally.

Running next-to-fetch CLI to analyze routes and output JSON, then generate a TypeScript API module.

npx next-to-fetch --format json npx next-to-fetch /users app/shared/api.ts
Debug
Known issues
gotchaRequires Next.js App Router; Pages Router not supported.
fix
Ensure project uses Next.js 13+ with app/ directory.
affects: >=0.0.0
gotchaCLI does not auto-detect project root; provide explicit paths.
fix
Run from project root or pass absolute/relative paths to route files or output.
affects: >=0.0.0
gotchaOutput file overwrites without warning; no --dry-run flag.
fix
Check output path or use version control before running.
affects: >=0.0.0
Errors
Common errors & fixes
npx: command not found: next-to-fetch
Package not installed or npx cache issue.
fix
Run 'npm install --save-dev next-to-fetch' first, then use npx from project directory.
Error: Cannot find module 'next-to-fetch'
Installed as dependency but not globally available.
fix
Run 'npx next-to-fetch' or install globally with 'npm install -g next-to-fetch' then use directly.
ENOENT: no such file or directory
Provided route path or output path does not exist.
fix
Verify paths are correct; use absolute paths or run from project root.
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
next-to-fetch — npm install next-to-fetch · libregistry