@types/express-list-endpoints
Advanced tools
@@ -1,2 +0,2 @@ | ||
| // Type definitions for express-list-endpoints 4.0 | ||
| // Type definitions for express-list-endpoints 6.0 | ||
| // Project: https://github.com/AlbertoFdzM/express-list-endpoints | ||
@@ -7,36 +7,36 @@ // Definitions by: S Joseph <https://github.com/sjoseph7> | ||
| /* =================== USAGE =================== | ||
| import * as express from "express"; | ||
| import listEndpoints from "express-list-endpoints"; | ||
| import * as express from "express"; | ||
| import listEndpoints from "express-list-endpoints"; | ||
| const app = express(); | ||
| 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('/') | ||
| .all(function(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 | ||
| }); | ||
| app.route('/about') | ||
| .get(function(req, res) { | ||
| // Handle request | ||
| }); | ||
| console.log(listEndpoints(app)); | ||
| console.log(listEndpoints(app)); | ||
| // It omits the 'all' verbs | ||
| ``` | ||
| [{ | ||
| path: '/', | ||
| methods: ['GET', 'POST'] | ||
| }, | ||
| { | ||
| path: '/about', | ||
| methods: ['GET'] | ||
| }] | ||
| ``` | ||
| // It omits the 'all' verbs. | ||
| [{ | ||
| path: '/', | ||
| methods: ['GET', 'POST'], | ||
| middlewares: ['namedMiddleware', 'anonymous', 'anonymous'] | ||
| }, | ||
| { | ||
| path: '/about', | ||
| methods: ['GET'], | ||
| middlewares: ['anonymous'] | ||
| }] | ||
@@ -53,2 +53,3 @@ =============================================== */ | ||
| methods: string[]; | ||
| middlewares: string[]; | ||
| } | ||
@@ -55,0 +56,0 @@ } |
| MIT License | ||
| Copyright (c) Microsoft Corporation. All rights reserved. | ||
| Copyright (c) Microsoft Corporation. | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
| { | ||
| "name": "@types/express-list-endpoints", | ||
| "version": "4.0.1", | ||
| "version": "6.0.0", | ||
| "description": "TypeScript definitions for express-list-endpoints", | ||
| "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-list-endpoints", | ||
| "license": "MIT", | ||
@@ -24,4 +25,4 @@ "contributors": [ | ||
| }, | ||
| "typesPublisherContentHash": "c8c8f8219a71a98ab18457be65dcc424c0a688c68b0700aee813beb0ba6f715f", | ||
| "typeScriptVersion": "2.8" | ||
| "typesPublisherContentHash": "559b11da5e86ca0b088f4927f96b80804d246a860e9952aa0c9170eb10fd6446", | ||
| "typeScriptVersion": "3.6" | ||
| } |
@@ -9,5 +9,65 @@ # Installation | ||
| Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-list-endpoints. | ||
| ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-list-endpoints/index.d.ts) | ||
| ````ts | ||
| // Type definitions for express-list-endpoints 6.0 | ||
| // Project: https://github.com/AlbertoFdzM/express-list-endpoints | ||
| // Definitions by: S Joseph <https://github.com/sjoseph7> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
| /* =================== 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: Mon, 09 Dec 2019 19:40:32 GMT | ||
| * Last updated: Wed, 18 Aug 2021 01:01:23 GMT | ||
| * Dependencies: [@types/express](https://npmjs.com/package/@types/express) | ||
@@ -17,2 +77,2 @@ * Global values: none | ||
| # Credits | ||
| These definitions were written by S Joseph (https://github.com/sjoseph7). | ||
| These definitions were written by [S Joseph](https://github.com/sjoseph7). |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5328
38.75%45
2.27%77
352.94%