{"repo":"tatethurston/nextjs-routes","free":true,"listed":false,"github":"https://github.com/tatethurston/nextjs-routes","clone":"git clone https://github.com/tatethurston/nextjs-routes.git","description":"Type safe routing for Next.js","language":"TypeScript","stars":629,"topics":["next","nextjs","routing","typescript"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Next.js Routes Type safe routing for Next.js What is this? 🧐 nextjs-routes generates type safe routing utilities from your pages and/or app directory. Notice If you are using Next.js's App Router you may not need this library. Next.js provides an experimental option to generate typed links. Next.js's option only works for the app directory, and not pages . If you're using the pages directory, or if you're using the app directory and want to use typed objects instead of string interpolation to provide URL parameters and queries, use this library. Highlights 🦄 Zero config 💨 Types only -- zero runtime (pages directory only) 🛠 No more broken links 🪄 Route autocompletion 🔗 Supports all Next.js route types: static, dynamic, catch all and optional catch all Installation & Usage 📦 1. Add this package to your project: 2. Update your next.config.js : 3. Start or build your next project: That's it! A @types/nextjs-routes.d.ts file will be generated the first time you start your server. Check this file into version control. next/link and next/router type definitions have been augmented to verify your application's routes. No more broken links, and you get route autocompletion 🙌. In development, whenever your routes change, your @types/nextjs-routes.d.ts file will automatically update. If you would prefer to generate the route types file outside of next dev or next build you can also invoke the cli directly: npx nextjs-routes . Examples 🛠 Link Link 's href prop is now typed based","default_branch":null,"files":null,"tree":[],"storefront":"/r/tatethurston","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tatethurston/nextjs-routes/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}