Giter VIP home page Giter VIP logo

route-list's People

Contributors

paker30 avatar seriouslag avatar vladimirmikulic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

route-list's Issues

Support async created apps

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.

It should recognize other folder structures

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:

  • Node.js v16.17.0
  • Express v4.18.2
  • TypeScript v4.8.4

Use ts-node instead of tsc

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.

Error on windows

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:'

Plans to make it also as a middleware

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.