Gathering detailed insights and metrics for express-jsdoc-swagger-extended
Gathering detailed insights and metrics for express-jsdoc-swagger-extended
Gathering detailed insights and metrics for express-jsdoc-swagger-extended
Gathering detailed insights and metrics for express-jsdoc-swagger-extended
npm install express-jsdoc-swagger-extended
Typescript
Module System
Min. Node Version
Node Version
NPM Version
56.4
Supply Chain
95.3
Quality
71.9
Maintenance
100
Vulnerability
97.9
License
JavaScript (100%)
Total Downloads
2,993
Last Day
1
Last Week
13
Last Month
28
Last Year
533
2 Stars
245 Commits
2 Watching
4 Branches
1 Contributors
Latest Version
1.3.5
Package Id
express-jsdoc-swagger-extended@1.3.5
Unpacked Size
63.68 kB
Size
20.58 kB
File Count
64
NPM Version
7.5.6
Node Version
15.9.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
13
Compared to previous week
Last month
55.6%
28
Compared to previous month
Last year
57.7%
533
Compared to previous year
With this library, you can document your express endpoints using swagger OpenAPI 3 Specification without writing YAML or JSON. You can write jsdoc comments on each endpoint, and the library is going to create the swagger UI.
This library assumes you are using:
npm i express-jsdoc-swagger
1const express = require('express'); 2const expressJSDocSwagger = require('express-jsdoc-swagger'); 3 4const options = { 5 info: { 6 version: '1.0.0', 7 title: 'Albums store', 8 license: { 9 name: 'MIT', 10 }, 11 }, 12 security: { 13 BasicAuth: { 14 type: 'http', 15 scheme: 'basic', 16 }, 17 }, 18 filesPattern: './**/*.js', // Glob pattern to find your jsdoc files (it supports arrays too ['./**/*.controller.js', './**/*.route.js']) 19 swaggerUIPath: '/your-url', // SwaggerUI will be render in this url. Default: '/api-docs' 20 baseDir: __dirname, 21 exposeSwaggerUI: true, // Expose OpenAPI UI. Default true 22 exposeApiDocs: false, // Expose Open API JSON Docs documentation in `apiDocsPath` path. Default false. 23 apiDocsPath: '/v3/api-docs', // Open API JSON Docs endpoint. Default value '/v3/api-docs'. 24}; 25 26const app = express(); 27const PORT = 3000; 28 29expressJSDocSwagger(app)(options); 30 31/** 32 * GET /api/v1 33 * @summary This is the summary or description of the endpoint 34 * @return {object} 200 - success response 35 */ 36app.get('/api/v1', (req, res) => res.json({ 37 success: true, 38})); 39 40app.listen(PORT, () => console.log(`Example app listening at http://localhost:${PORT}`)); 41
1const options = { 2 info: { 3 version: '1.0.0', 4 title: 'Albums store', 5 license: { 6 name: 'MIT', 7 }, 8 }, 9 security: { 10 BasicAuth: { 11 type: 'http', 12 scheme: 'basic', 13 }, 14 }, 15 filesPattern: './**/*.js', // Glob pattern to find your jsdoc files 16 baseDir: __dirname, 17};
1/** 2 * A song type 3 * @typedef {object} Song 4 * @property {string} title.required - The title 5 * @property {string} artist - The artist 6 * @property {number} year - The year - double 7 */
Songs
model array1/** 2 * GET /api/v1/albums 3 * @summary This is the summary or description of the endpoint 4 * @tags album 5 * @return {array<Song>} 200 - success response - application/json 6 */ 7app.get('/api/v1/albums', (req, res) => ( 8 res.json([{ 9 title: 'abum 1', 10 }]) 11));
1/** 2 * GET /api/v1/album 3 * @summary This is the summary or description of the endpoint 4 * @security BasicAuth 5 * @tags album 6 * @param {string} name.query.required - name param description 7 * @return {object} 200 - success response - application/json 8 * @return {object} 400 - Bad request response 9 */ 10app.get('/api/v1/album', (req, res) => ( 11 res.json({ 12 title: 'abum 1', 13 }) 14));
1/** 2 * GET /api/v1/albums 3 * @summary This is the summary or description of the endpoint 4 * @tags album 5 * @return {array<Song>} 200 - success response - application/json 6 * @example response - 200 - success response example 7 * [ 8 * { 9 * "title": "Bury the light", 10 * "artist": "Casey Edwards ft. Victor Borba", 11 * "year": 2020 12 * } 13 * ] 14 */ 15app.get('/api/v1/albums', (req, res) => ( 16 res.json([{ 17 title: 'track 1', 18 }]) 19));
You can find more examples here, or visit our documentation.
Briam Martinez Escobar 💻 | Kevin Julián Martínez Escobar 💻 | Heung-yeon Oh 💻 | Sara Hernández 💻 | Josep Servat 💻 | Nick Dong 💻 | Aleksander Stós 💻 |
Kjell Dankert 💻 | juliendu11 💻 | Mohamed Meabed 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/27 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More