Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-climber

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-climber

Express router autodoc

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

express-climber

Build Status Coverage Status

npm install --save express-climber

This package aims to list all your routes declared in a Router or in an Application. It is tested with express at version 4.13.3. Please tell me if with another version this module fails. Middleware or router handler have a name, a description and a long_description. The name is the function name. To fill description and long_description, add those properties to the function like this:

function myHandle(req, res) {
  ...
}
myHandle.description = 'This is the description';
myHandle.long_description = 'This is the long description where you can describe better the behaviour for this handler.';

If you want to hide a middleware, add hideInClimber property to the function like this:

function myMiddleware(req, res, next) {
  ...
}
myMiddleware.hideInClimber = true;

And myMiddleware will be not listed.

getAsStructure

Return a complex structure. In the structure the keys are the routes and the values are a description of what is attached there Example of output:

{
  '/': {
    get: { middlewares: [ ... ] },
    post: { middlewares: [ ... ] },
    put: { middlewares: [ ... ] },
    delete: { middlewares: [ ... ] }
  },
  '/foo': {
    get: { handle: { ... }, middlewares: [ ... ] },
    post: { handle: { ... }, middlewares: [ ... ] }
  }
}

See the tests for more informations.

getAsArray

This returns na array that contains all routes defined. Example of output:

[
  {
    method: 'get',
    middlewares: [ ... ],
    handle: { ... },
    url: '/foo'
  },
  {
    method: 'post',
    middlewares: [ ... ],
    handle: { ... },
    url: '/foo'
  },
  {
    method: 'delete',
    middlewares: [ ... ],
    handle: { ... },
    url: '/bar'
  }
]

Contributing

Any suggestion are accepted. Please open an issue or make a PR.

Keywords

FAQs

Package last updated on 02 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc