Skip to content

miraclerose311/Next-routes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-routes-list

Easy generate all available routes in Next.js .

Support

  • App routes
  • Page routes

Install

npm install --save-dev next-routes-list@latest

Usage

1. Run script

add script to package.json:

{
  "script": {
    "generate-next-routes-list": "generate-next-routes-list"
  }
}

If you use src directory:

{
  "script": {
    "generate-next-routes-list": "cd src && npx generate-next-routes-list"
  }
}

then run npm script:

npm run generate-next-routes-list

2. Import routes

import { routes } from 'next-routes-list'

console.log(routes)
/**
[
  '/',
  '/about',
  '/posts/[id]',
  ...
]
*/

Example

next projct is here, generate result is: here.

Contribute

feel free to contribute anything or report any issues.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published