Installations
npm install swagger-express-jsdoc
Developer Guide
Typescript
No
Module System
N/A
Node Version
10.13.0
NPM Version
6.4.1
Score
46.3
Supply Chain
93.8
Quality
70.5
Maintenance
25
Vulnerability
97.3
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (94.34%)
EJS (4.15%)
CSS (1.51%)
Developer
SangHakLee
Download Statistics
Total Downloads
60,532
Last Day
1
Last Week
23
Last Month
142
Last Year
1,700
GitHub Statistics
12 Stars
11 Commits
4 Forks
2 Watching
5 Branches
1 Contributors
Package Meta Information
Latest Version
1.0.4
Package Id
swagger-express-jsdoc@1.0.4
Unpacked Size
11.36 kB
Size
4.04 kB
File Count
10
NPM Version
6.4.1
Node Version
10.13.0
Total Downloads
Cumulative downloads
Total Downloads
60,532
Last day
-93.3%
1
Compared to previous day
Last week
-39.5%
23
Compared to previous week
Last month
0.7%
142
Compared to previous month
Last year
-59.8%
1,700
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
swagger-express-jsdoc
Example of Express with swagger-jsdoc
Install
git
1$ git clone https://github.com/SangHakLee/swagger-express-jsdoc.git
NPM
1$ npm i swagger-express-jsdoc 2$ cd node_modules
How to use
Start Server
1$ cd swagger-express-jsdoc 2$ npm install 3$ npm start
Use swagger-jsdoc
http://localhost:3000/api-docs/
How to add api-docs
This application is based on Swagger, swagger-jsdoc and swagger-ui-express
app.js
1// ... 2var swaggerUi = require('swagger-ui-express'); // line 7 3var swaggerJSDoc = require('swagger-jsdoc'); // line 8 4 5// ... 6var options = { // line 27 7 swaggerDefinition: { 8 info: { 9 title: 'swagger-express-jsdoc', // Title (required) 10 version: '1.0.0', // Version (required) 11 }, 12 }, 13 apis: ['./routes/*'], // Path to the API docs 14}; 15var swaggerSpec = swaggerJSDoc(options); // line 36 16 17// ... 18app.get('/api-docs.json', function(req, res) { // line 41 19 res.setHeader('Content-Type', 'application/json'); 20 res.send(swaggerSpec); 21}); 22 23// ... 24app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); // line 45
var options (line 27)
Your Swagger docs information here. swagger-jsdoc
swaggerDefinition.info
1{ 2 "title": "Swagger Sample App", 3 "description": "This is a sample server Petstore server.", 4 "termsOfService": "http://swagger.io/terms/", 5 "contact": { 6 "name": "API Support", 7 "url": "http://www.swagger.io/support", 8 "email": "support@swagger.io" 9 }, 10 "license": { 11 "name": "Apache 2.0", 12 "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 13 }, 14 "version": "1.0.1" 15}
apis
Your routing files path. If your routing file path like this,
- /controllers/users.js
- /controllers/stores.js
Set your apis
value like this, apis: ['./controllers/*']
var swaggerSpec (line 36)
It will be json object.
Your option
value and apis
value are combined.
/api-docs.json (line 41)
This returns a simple json document. http://localhost:3000/api-docs.json
/api-docs (line 45)
This will convert the json document to Swagger-ui. So when you connect with http://localhost:3000/api-docs, it will make you see beautiful documents.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Reason
17 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-6c9x-mj3g-h47x
- Warn: Project is vulnerable to: GHSA-qrmm-w75w-3wpx
- Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5
Score
1.3
/10
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 MoreOther packages similar to swagger-express-jsdoc
express-jsdoc-swagger
Swagger OpenAPI 3.x generator
swagger-jsdoc-express
Parses JSDoc comments from files and strings and set ups Swagger UI from it, to be used with Express framework.
swagger-express
Document your express rest api by jsDoc or yaml.
express-jsdoc-swagger-extended
Swagger OpenAPI 3.x generator