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

0.1.0 • Public • Published

TsDox

TsDox is a utility to transform Typescript AST to JSON. It extracts the following data

  • classes
  • interfaces
  • methods
  • functions
  • properties
  • enums
  • comments (grouped by JsDoc tags, but untransformed text)
  • decorator

There is no command line interface. The library is meant to be used with tools lke gulp or webpack to render project documentation pages. Since every project has differen requirements, this library will not aim to offer a "ready to use" solution for rendering the doc files.

An example how to use it with

const path = require("path")
const tsdox = require("tsdox")

gulp
  .src("**/*.ts")
  .pipe(tsdox.transform())
  // or if you want to concat all the files into a single json, use
  // .pipe(tsdox.transform({ concat: "api.json" }))
  .pipe(gulp.dest("dist"))

If you use typescript to write a documentation renderer, you can use the typings like this

import {
  TsDoxFile,
  TsDoxClass,
  TsDoxInterface,
  TsDoxFunction,
  TsDoxMethod,
  TsDoxConstructor,
  TsDoxProperty,
  TsDoxParameter,
  TsDoxModifiers,
} from "tsdox/lib/runtime"

Package Sidebar

Install

npm i ts-dox

Weekly Downloads

174

Version

0.1.0

License

MIT

Unpacked Size

45.6 kB

Total Files

21

Last publish

Collaborators

  • ginie