An API reference generator for TypeScript.
Last updated 6 days ago by 3h .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dts2md 
SYNC missed versions from official npm registry.



dts2md is an API reference generator for TypeScript, which transforms your type declaration files into markdown documentation.

Typically, you write documentation comments in your TypeScript source files, use TypeScript compiler to generate type declaration files, and use dts2md to generate final API reference from the type declaration files which contains the comments.

The API reference of dts2md is just generated using the package itself, which is available at the wiki page.


The package has a built-in cli, so you can just install and use it in the command line.

$ dts2md --help
Generate API reference from your type declaration files.

  dts2md <action> [options]

  <globs...>                    Source file globs (default: *)

  --input, -i <dir>             The input root
  --output, -o <dir>            The output root
  --log, -l                     Log transform info
  --index, -I [file]            Generate an index file (default file name: API.md)
  --encoding, -e <encoding>     The encoding of source files (default: utf8)
  --help, -h                    Show help info

If you want to specify more generating options, you can use dts2md as a dependency and create your own generating script. The API reference is available at the wiki page.

By default, the code from each type declaration file is transformed and then displayed in a fenced code block in generated markdown documentation.

During transformation, transform reducers are applied one by one, each of which modifies the code. Specifically, there is a built-in reducer that convert break marks(/** dts2md break */) into line breaks, to provide custom line breaks because the TypeScript compiler may remove original line breaks. You can use dts2md programmatically and compose the reducers to customize your documentation.


Current Tags

  • 0.4.2                                ...           latest (6 days ago)

9 Versions

  • 0.4.2                                ...           6 days ago
  • 0.4.1                                ...           a month ago
  • 0.4.0                                ...           2 months ago
  • 0.3.3                                ...           3 months ago
  • 0.3.1                                ...           3 months ago
  • 0.3.0                                ...           3 months ago
  • 0.2.0                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
Maintainers (1)
Today 0
This Week 11
This Month 11
Last Day 0
Last Week 1
Last Month 1
Dependencies (3)
Dev Dependencies (2)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |