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 🙏

© 2025 – Pkg Stats / Ryan Hefner

api-docs-generator

v0.0.11-preview-1a

Published

Api-Docs-Generator is a nodejs library that automatically generate postman collection, postman api documentation and gitbook. Although this is a preview version, which means the library will and continue to undergo serious testing and contributions from a

Downloads

46

Readme

Api-Docs-Generator

Api-Docs-Generator is a nodejs library that automatically generate postman collection, postman api documentation and gitbook. Although this is a preview version, which means the library will and continue to undergo serious testing and contributions from anyone interested in the project. Api Documentation and Gitbook will be available in subsequent version.

Installation

To Install please run npm install or yarn, see sample below

npm install apidocs
yarn add apidocs

Usage

To use this library to generate postman collection of your project, here is what you need to do. For this library to work effectively, your controller class/functions needs to be decorated with some attribute and each line of these attributes will start with ///. The type of decoration to use depends on what you are trying to achieve.

For example, your controller class can be marked as @Controller(UserController, api/v1/user) or @Controller(UserController)

Detailed Guide

The library expect you to define a file named api-docs.json at the root of your project, although this can be overriden in cli with filename of your choice. See below for content of the file

{
    "AppTitle":"json_schema",
    "Description":"The USSD WALLET FUNDING",
    "BaseUrl":"https://ussd.aellapp.com",
    "BasePath":"api/v2",
    "Host":"ussd.aellapp.com",
    "Headers":{
        "Content-Type":"application/json",
        "x-aella-user":"v1"
    },
    "OutputDir":"Samples",
    "dirToCrawl":".",
    "dirToIgnore":[".gitignore", "*.json"]
}

The OutputDir specify the directory where the collection file will be generated to, dirToIgnore specifify the list of files/directories to ignore while crawling/scanning your directory for attributes used to generate file, dirToCrawl specify the directory that will be used for scanning of the directories. It is default to . except you specify otherwise

after the the library has scanned and reviewed the content of api-docs.json, please run

    apidocs init --file=docs.json where --file will be specified when you need to override the default configuration settings

List Of Attribute Note: {} means required, [] means optional @Controller({ControllerName}, [ControllerPath]) = ControllerName is the name of controller, controller path is path/route of the controller that other endpiont witll follow e.g. api/v2/usercontroller etc

Method can come in two forms (a) @Method({MethodName};{HttpMethod};{EndpointPath}) (b) Method=({MethodName};{HttpMethod};{EndpointPath})

@Query({pageIndex:1}) @Query is use to specify query string of your endpoint @Params({}) @Params is used to specify route params on your endpoint

@Headers({}) @Headers is used to specify the list of headers on your endpoint @Body({}) @Body is used to specify the body request of your endpoint

Typical Example

See below an example of how to use the attributes explained above

    /// @Controller(WalletController, 'api/wallet')
  export class WalletFundingController {
   // private serviceName: string;
    constructor() {
      this.serviceName = this.config.get<string>('SERVICE_NAME');
    }

     /// Method=BankLisiting;GET;'bank-listing')
     /// @Produces([application/json])
     /// Query({pageIndex:1,pageSize:10})
     /// @Description('returns list of banks in the system')
     /// @Folder([Bank, Listing]) for version 2.0
    async BankShortCodeListing() {
       
     // return SuccessResponse(res, await this.service.ListBanks(), this.serviceName);
    }
  }

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT