A library that generates JSON documentation for TypeScript code by correlating the TypeScript typing with JsDocs comments.
npm install typedocs




TypeDocs is a library that helps generate API documentation for TypeScript code.
```
npm install typedocs
To get documentation programmatically, you can invoke this library
programmatically as follows: -
`ts
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: -
`ts
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.",
}
}
});
`
The samples folder contains an app that demonstrates the usage above. You can
run the below command to exercise it.
```
node sampleapp.js
To contribute to the project please go through the
Contributing.md guide.