Installations
npm install static-api-docs
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 0.10.0
Node Version
6.10.0
NPM Version
3.10.10
Score
41.4
Supply Chain
82
Quality
65.6
Maintenance
25
Vulnerability
96.8
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
HTML (82.28%)
JavaScript (17.72%)
Developer
spatialdev
Download Statistics
Total Downloads
11,265
Last Day
3
Last Week
24
Last Month
80
Last Year
723
GitHub Statistics
3 Stars
57 Commits
2 Forks
21 Watching
3 Branches
20 Contributors
Bundle Size
530.00 B
Minified
327.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.1.11
Package Id
static-api-docs@0.1.11
Size
19.32 kB
NPM Version
3.10.10
Node Version
6.10.0
Total Downloads
Cumulative downloads
Total Downloads
11,265
Last day
0%
3
Compared to previous day
Last week
-35.1%
24
Compared to previous week
Last month
-48.4%
80
Compared to previous month
Last year
-16.1%
723
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
static-api-docs
Transfrom API documentation stored in Swagger spec YAML into formatted markdown and static HTML files. See the example output below.
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
1npm install static-api-docs --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
1grunt.loadNpmTasks('static-api-docs');
The "static_api_docs" task
Overview
In your project's Gruntfile, add a section named static_api_docs
to the data object passed into grunt.initConfig()
.
1grunt.initConfig({
2 static_api_docs: {
3 your_target: {
4 src: "path/to/the/swagger/spec/YAML/for/API"
5 dest: "path/to/the/destination/directory"
6 options: {
7 filename: "filename"
8 suppressMD: false
9 suppressHTML: false
10 }
11 },
12 },
13})
Options
target.options.filename
Type: String
Default value: 'api-doc'
A string value that will be the root of the generated files (api-doc.md, api-doc.html).
target.options.suppressMD
Type: Boolean
Default value: false
A boolean that turns off generation of markdown output.
target.options.suppressHTML
Type: Boolean
Default value: false
A boolean that turns off generation of HTML output.
Usage Examples
1grunt.initConfig({
2 static_api_docs: {
3 test: {
4 src: 'swagger.json',
5 dest: 'outputDir',
6 options: {
7 filename: 'my-static-doc',
8 }
9 }
10 },
11})
Example Input and Output
Some example output created by this plugin and some example JSON following Swagger spec .
Uber API: v1.0.0
Table of Contents
/products      Products
#### /products  ![GET](images/get.png)
Get all products with all attributes.
Parameters
Name | Required | In | Type | Description |
---|---|---|---|---|
category | false | query | string | Filter by product category (e.g., "gizmo") |
Success 200 (Object[])
Name | Type | Description |
---|---|---|
product_id | string | Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. |
description | string | Description of product. |
display_name | string | Display name of product. |
category | string | Category of product. For example, "gizmo". |
Error 500 (Object)
Name | Type | Description |
---|---|---|
code | integer | |
message | string | |
fields | string |
Notes on nested response JSON
In the event that your response JSON includes nested data, Static API Docs will render the nested properties with indentation. For example, a response property named "components" might be an object array, and can be represented ins Swagger spec JSON like:
"components": {
"type": "array",
"items": {
"type": "object",
"properties": {
"component_id": {
"type": "integer",
"description": "Unique identifier."
},
"component_name": {
"type": "string",
"description": "Display name of component."
}
}
}
}
The plugin will render the object array like this:
Name | Type | Description |
---|---|---|
components | Object[] | |
-Â component_id | integer | Unique identifier representing a specific component of a product. |
-Â component_name | string | Display name of component. |
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
(Nothing yet)
License
Copyright (c) 2015 Spatial Development International, LLC. Licensed under the Apache license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 1/22 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
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
project is not fuzzed
Details
- Warn: no fuzzer integrations found
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 9 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-01-27
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 static-api-docs
spectacle-docs
Generate beautiful static API documentation from OpenAPI/Swagger 2.0 specifications
@surveylegend/hapi-docs
Beautiful API documentation generator for Hapi using Vue
@braks/revue-draggable
[![Revue Draggable](./docs/static/revue-draggable.gif)](https://draggable.vueflow.dev)
mol_db
Static typed facade for [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) with simple API.