vladimirmikulic / route-list Goto Github PK
View Code? Open in Web Editor NEWBeautifully shows Express/Koa/Hapi/Fastify routes in CLI.
Home Page: https://www.npmjs.com/package/route-list
License: MIT License
Beautifully shows Express/Koa/Hapi/Fastify routes in CLI.
Home Page: https://www.npmjs.com/package/route-list
License: MIT License
Do you have any plans to make it also as a middleware or library for express or koa?
As one time usage, by passing application object, in case of express, into a function from this project.
Would be great, kind of hapi-print-routes!
Good work!
This library should support async apps (awaiting the default import of the app)
My apps usually have an async startup and this library cannot be used on my app.
This library would be useful if it resolved any promises returned by the app.
npx route-list ./src/api/app.js
Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received
protocol 'd:'
Hi there!
When I tried this package, I gave the following input:
route-list --group --methods source/app.ts
# I also tried:
route-list --group --methods ./source/app.ts
I got the following error/output message:
error: missing required argument 'appjs-file'
Usage: route-list [options] <appjs-file>
Beautifully shows Express/Koa/Hapi/Fastify routes in CLI.
Options:
-g, --group Display routes in groups separated with new line
-m, --methods <methods> Include routes registered for HTTP method(s)
-i, --include-paths <paths> Include routes starting with path(s)
-e, --exclude-paths <paths> Exclude routes starting with path(s)
-V, --version output the version number
-h, --help display help for command
Examples:
$ route-list server/app.js
$ route-list --methods GET,POST server/app.js
$ route-list --include-paths /users,/events server/app.js
This is my folder structure
(./source/app.ts
file contains the const app: Express = express();
initialization):
.
├── build/
│ └── ...
├── coverage/
│ └── ...
├── node_modules/
│ └── ...
├── source/
│ ├── db/
│ ├── handlers/
│ ├── middlewares/
│ ├── public/
│ ├── repository/
│ ├── routes/
│ ├── schemas/
│ ├── services/
│ ├── types/
│ ├── utils/
│ ├── views/
│ ├── app.ts
│ └── index.ts
├── .env.example
├── jest.config.ts
├── package-lock.json
├── package.json
├── README.md
└── tsconfig.json
Additional Info:
When the package is used on a typescript project the project is compiled and output-ed to a routelist folder.
I think a better user experience would be if there was no output and ts-node was used instead of TSC.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.