sveltekit-route-list Svelte Themes

Sveltekit Route List

A CLI tool to view and analyze all routes in your SvelteKit application.

sveltekit-route-list

A CLI tool to view and analyze all routes in your SvelteKit application.

Installation

Global Installation

npm install -g sveltekit-route-list

Local Installation (Dev Dependency)

npm install --save-dev sveltekit-route-list

Usage

Run the command in your SvelteKit project root:

sveltekit-route-list

Or specify a custom routes directory:

sveltekit-route-list path/to/your/routes

If installed locally, add to your package.json scripts:

{
  "scripts": {
    "routes": "sveltekit-route-list"
  }
}

Then run:

npm run routes

Features

  • šŸ“‹ Lists all pages, endpoints, and layouts
  • šŸ”„ Shows HTTP methods for API endpoints
  • šŸ“ Displays file types (+page.svelte, +server.ts, etc.)
  • šŸŽÆ Handles dynamic routes ([param], [...rest], [[optional]])
  • šŸ“Š Beautiful table output with route statistics

Output Example

Scanning routes in: /your-project/src/routes

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Methods    │ Path         │ Type     │ Files             │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│ GET        │ /            │ page     │ +page.svelte      │
│ GET        │ /about       │ page     │ +page.svelte      │
│ GET|POST   │ /api/users   │ endpoint │ +server.ts        │
│ GET        │ /blog/:slug  │ page     │ +page.svelte      │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Total routes: 4
Total layouts: 1

Supported Route Types

  • +page.svelte - Page components
  • +page.server.ts/js - Page server load functions
  • +server.ts/js - API endpoints
  • +layout.svelte - Layout components
  • +layout.server.ts/js - Layout server functions

Dynamic Routes

The tool automatically converts SvelteKit route syntax:

  • [param] → :param (required parameter)
  • [[optional]] → :optional? (optional parameter)
  • [...rest] → :rest* (rest parameter)

Requirements

  • Node.js >= 14.0.0
  • A SvelteKit project

License

MIT

Top categories

Loading Svelte Themes