Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@types/express-list-endpoints
Advanced tools
TypeScript definitions for express-list-endpoints
npm install --save @types/express-list-endpoints
This package contains type definitions for express-list-endpoints (https://github.com/AlbertoFdzM/express-list-endpoints).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-list-endpoints.
/* =================== 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;
These definitions were written by S Joseph.
FAQs
TypeScript definitions for express-list-endpoints
We found that @types/express-list-endpoints demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.