npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@direwolf2494/apidoc-swagger

v0.2.8

Published

Convert api doc json to swagger json

Readme

apidoc-swagger

Build status: CircleCI

apidoc and swagger are two nice projects which are focusing on documentation of APIs. This project is a middle tier which tries to bring them together in a sense that:

It uses apidoc to convert inline documentation comments into json schema and later convert it to swagger json schema.

Uses the apidoc-core library.

How It Works

By putting in line comments in the source code like this in javascript, you will get swagger.json file which can be served to swagger-ui to generate html overview of documentation.

/api/foo.js:

/**
 * @api {get} /user/id Request User information
 * @apiName GetUser
 * @apiGroup User
 *
 * @apiParam {Number} id Users unique ID.
 *
 * @apiSuccess {String} firstname Firstname of the User.
 * @apiSuccess {String} lastname  Lastname of the User.
 */

Installation

npm install apidoc-swagger -g

Current version unlocks most of the basic capabilities of both projects and improvement is in progress.

Example

apidoc-swagger -i example/ -o doc/

Options

The following options can be used to customize the behavior of apidoc-swagger:

| Long Name | Abbreviation | Default | Description | | --------- | ------------ | ------- | ----------- | | --input | -i | REQUIRED | Input / source dirname. | | --file-filters | -f | .*\\.(clj|coffee|cs|dart|erl|go|java|scala|js|php?|py|rb|ts|pm)$ | RegEx-Filter to select files that should be parsed. | | --exclude-filters | -e | | RegEx-Filter to select files / dirs that should not be parsed. | | --output | -o | ./doc/ | Output dirname. | | --verbose | -v | false | Vebose debug output. | | --help | -h | | Shows help information | | --debug | | false | Show debug message | | --color | | true | Turn off log color | | --host | | | target host to use instead of url in package.json/apidoc.json | | --default-response | | false | uses default success responses instead of api doc generated responses | | --base-path | | / | basepath for the api | | --schemes | | http | comma separated list of url schemes | | --parse | | false | Parse only the files and return the data, no file creation. | | --parse-filters | | | Optional user defined filters. Format name=filename. | | --parse-languages | | | Optional user defined languages. Format name=filename. | | --parse-parsers | | | Optional user defined parsers. Format name=filename | | --parse-workers | | | Optional user defined workers. Format name=filename | | --silent | | false | Turn all output off | | --simulate | | false | Execute but don't create output file | | --markdown | | false | Turn on markdown parser | | --marked-config | | | Enable custom markdown parser configs. It will overwite all other marked settings. | | --marked-gfm | | false | Enable GitHub flavored markdown. | | --marked-tables | | false | Enable GFM tables. This option requires the gfm option to be true. | | --marked-breaks | | false | Enable GFM line breaks. This option requires the gfm option to be true. | | --marked-pedantic | | false | Conform to obscure parts of markdown.pl as much as possible. | | --marked-sanitize | | false | Sanitize the output. Ignore any HTML that has been input. | | --marked-smartLists | | false | Use smarter list behavior than the original markdown. | | --marked-smartypants | | false | Use 'smart' typograhic punctuation for things like quotes and dashes. |

Have a look at apidoc for full functionality overview and capabilities of apidoc.

To read more about how swagger works refer to swagger-ui and swagger-spec for details of swagger.json.

Gulp Module

gulp-apidoc-swagger npm install gulp-apidoc-swagger.