# ts-dox

> Transforms typescript AST to JSON

Latest version **0.1.0** (published 2021-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-dox
pnpm add ts-dox
yarn add ts-dox
bun add ts-dox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-07-27 |
| First published | 2018-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 44.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Alexander Gräfenstein |
| Maintainers | ginie |
| Keywords | typescript, documentation, extract, json, library |

## Links

- npm: https://www.npmjs.com/package/ts-dox
- Repository: github.com/giniedp/ts-dox
- npm.io page: https://npm.io/package/ts-dox

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-07-27
- 0.0.7 — 2018-05-01
- 0.0.6 — 2018-04-20
- 0.0.5 — 2018-04-20
- 0.0.4 — 2018-04-18
- 0.0.3 — 2018-04-15
- 0.0.2 — 2018-04-14
- 0.0.1 — 2018-04-13

## README

# 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

```js
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

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

---
_Source: https://npm.io/package/ts-dox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
