{"id":14969204,"url":"https://github.com/vladimirmikulic/route-list","last_synced_at":"2025-05-15T11:05:07.968Z","repository":{"id":61558791,"uuid":"552499040","full_name":"VladimirMikulic/route-list","owner":"VladimirMikulic","description":"Beautifully shows Express/Koa/Hapi/Fastify routes in CLI.","archived":false,"fork":false,"pushed_at":"2024-10-24T16:28:37.000Z","size":635,"stargazers_count":393,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T18:14:31.066Z","etag":null,"topics":["command-line-tool","expressjs","fastify","hapi","koa","routes"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/route-list","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VladimirMikulic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-16T18:23:08.000Z","updated_at":"2025-04-03T05:04:27.000Z","dependencies_parsed_at":"2024-10-11T03:00:34.042Z","dependency_job_id":"a7cc79b7-63be-41d4-9149-cb5f3d072cc4","html_url":"https://github.com/VladimirMikulic/route-list","commit_stats":{"total_commits":21,"total_committers":4,"mean_commits":5.25,"dds":"0.19047619047619047","last_synced_commit":"f0edff975931d68577e9875f08888c86a499141d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VladimirMikulic%2Froute-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VladimirMikulic%2Froute-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VladimirMikulic%2Froute-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VladimirMikulic%2Froute-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VladimirMikulic","download_url":"https://codeload.github.com/VladimirMikulic/route-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248933340,"owners_count":21185460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","expressjs","fastify","hapi","koa","routes"],"created_at":"2024-09-24T13:41:21.507Z","updated_at":"2025-04-14T18:14:35.407Z","avatar_url":"https://github.com/VladimirMikulic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# route-list\n\n![Version](https://img.shields.io/npm/v/route-list)\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n[![CI](https://github.com/VladimirMikulic/route-list/actions/workflows/ci.yml/badge.svg)](https://github.com/VladimirMikulic/route-list/actions)\n[![Twitter: VladoDev](https://img.shields.io/twitter/follow/VladoDev.svg?style=social)](https://twitter.com/VladoDev)\n\n\u003e ✨ Beautifully shows Express/Koa/Hapi/Fastify routes in CLI.\n\n![route-list CLI example](./screenshots/showcase.png)\n\n## 📦 Installation\n\n```sh\n# Installs the package so it's globally accessible in terminal\nnpm i route-list -g\n```\n\n## 🔌 Configuration\n\nBefore you can use `route-list` on your project, we first need to make sure it's configured properly.\nIn order for `route-list` to work, we need to export server \"app\".\nThe example below is for Express but it also applies to Koa (with @koa/router)/Hapi/Fastify.\n\n**app.js** / **app.ts**\n\n```js\nconst app = express();\n\napp.get('/', (req, res) =\u003e res.sendStatus(200));\napp.get('/products', (req, res) =\u003e res.sendStatus(200));\napp.get('/products/:id', (req, res) =\u003e res.sendStatus(200));\n\n// CJS\n// Option 1: module.exports = app;\n// Option 2: module.exports = { app, yourOtherExports... };\n// Option 3: module.exports = functionThatReturnsApp;\n\n// ESM\n// Option 1: export default app;\n// Option 2: export default { app, yourOtherExports... };\n// Option 3: export default functionThatReturnsApp;\n```\n\n\u003e NOTE: In case you use [SocketIO with Express](https://socket.io/get-started/chat#the-web-framework), make sure to **export Express app**, not `http.createServer` server instance.\n\n## ☁️ Usage\n\n### Options\n\n- `-g, --group` - Display routes in groups separated with new line\n- `-m, --methods \u003cmethods\u003e` - Include routes registered for HTTP method(s)\n- `-i, --include-paths \u003cpaths\u003e` - Include routes starting with path(s)\n- `-e, --exclude-paths \u003cpaths\u003e` - Exclude routes starting with path(s)\n\n### Examples\n\n```sh\nroute-list server/app.js\n```\n\n```sh\nroute-list --group server/app.js\n```\n\n```sh\nroute-list --methods GET,POST server/app.js\n```\n\n\u003e NOTE: In case an app is part of NX monorepo, make sure to build it first.\n\n## 💻 Programmatic Usage\n\n```js\nimport RouteList from 'route-list';\n\n// Example result { \"/\": [\"GET\"], \"/users\": [\"GET\", \"POST\"] }\nconst routesMap = RouteList.getRoutes(app, 'express');\n\n// Print routes to console\nRouteList.printRoutes(routesMap);\n```\n\n## 👨 Author\n\n**Vladimir Mikulic**\n\n- Twitter: [@VladoDev](https://twitter.com/VladoDev)\n- Github: [@VladimirMikulic](https://github.com/VladimirMikulic)\n- LinkedIn: [@vladimirmikulic](https://www.linkedin.com/in/vladimir-mikulic/)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\n## 🍻 Credits\n\nThe project was inspired by new `route:list` command in Laravel 9.\nNew [`route:list`](https://github.com/laravel/framework/pull/40269) itself was\ninspired by [`pretty-routes`](https://github.com/Wulfheart/pretty-routes) project.\nBig thanks to [Λlex Wulf](https://twitter.com/alexfwulf) for building\n`pretty-routes` and Laravel community for recognizing the usefulness of the project.\n\n## ✏️ License\n\nThis project is licensed under [MIT](https://opensource.org/licenses/MIT) license.\n\n## 👨‍🚀 Show your support\n\nGive a ⭐️ if this project helped you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirmikulic%2Froute-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladimirmikulic%2Froute-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirmikulic%2Froute-list/lists"}