Socket
Socket
Sign inDemoInstall

@types/express-list-endpoints

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/express-list-endpoints

TypeScript definitions for express-list-endpoints


Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/express-list-endpoints

Summary

This package contains type definitions for express-list-endpoints (https://github.com/AlbertoFdzM/express-list-endpoints).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-list-endpoints.

index.d.ts

/* =================== USAGE ===================
import * as express from "express";
import listEndpoints from "express-list-endpoints";

const app = express();

app.route('/')
  .all(function namedMiddleware(req, res) {
    // Handle request
  })
  .get(function(req, res) {
    // Handle request
  })
  .post(function(req, res) {
    // Handle request
  });

app.route('/about')
  .get(function(req, res) {
    // Handle request
  });

console.log(listEndpoints(app));

// It omits the 'all' verbs.
[{
    path: '/',
    methods: ['GET', 'POST'],
    middlewares: ['namedMiddleware', 'anonymous', 'anonymous']
  },
  {
    path: '/about',
    methods: ['GET'],
    middlewares: ['anonymous']
}]

 =============================================== */

import express = require("express");

declare function listEndpoints(app: express.Express): listEndpoints.Endpoint[];

declare namespace listEndpoints {
    interface Endpoint {
        path: string;
        methods: string[];
        middlewares: string[];
    }
}

export = listEndpoints;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:36 GMT
  • Dependencies: @types/express

Credits

These definitions were written by S Joseph.

FAQs

Package last updated on 07 Nov 2023

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