typedocs
TypeScript icon, indicating that this package has built-in type declarations

0.6.7 • Public • Published

TypeDocs

Build Status npm version Coverage Status TypeDocs license GitHub tag

TypeDocs is a library that helps generate API documentation for TypeScript code.

Installing

npm install typedocs

Usage

To get documentation programmatically, you can invoke this library programmatically as follows: -

import * as typedocs from "typedocs";
 
"use strict";
 
const sourceFileName = "path/to/declaration.d.ts";
 
// Generate documentation by calling the generate function
// passing in the definition files.
const result = typedocs.generate([sourceFileName]);
 
// Optionally you can flatten the modules to include
// separate items for nested modules.
const flatResult = typedocs.flattenModules(result);

To generate a docs website, execute the following: -

import * as typedocs from "typedocs";
 
"use strict";
 
const sourceFileName = "path/to/declaration.d.ts";
 
// Generate documentation by calling the generate function
// passing in the definition files.
const result = typedocs.generate([sourceFileName], {
    websiteOptions: {
        dir: "./myproductwebsite",
        resources: {
            productName: "My awesome product",
            productDescription: "The description for my awesome product.",
        }
    }
});

Sample

The samples folder contains an app that demonstrates the usage above. You can run the below command to exercise it.

node sampleapp.js

Contributing

To contribute to the project please go through the Contributing.md guide.

Dependencies (2)

Dev Dependencies (9)

Package Sidebar

Install

npm i typedocs

Weekly Downloads

61

Version

0.6.7

License

MIT

Unpacked Size

442 kB

Total Files

53

Last publish

Collaborators

  • alvarorahul