https://github.com/borgar/jsdoc-tsmd
A (limited) JSDoc template that prints Markdown and TypeScript declaration files
https://github.com/borgar/jsdoc-tsmd
Last synced: about 2 months ago
JSON representation
A (limited) JSDoc template that prints Markdown and TypeScript declaration files
- Host: GitHub
- URL: https://github.com/borgar/jsdoc-tsmd
- Owner: borgar
- License: mit
- Created: 2023-08-02T15:37:59.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-28T18:03:24.000Z (about 2 years ago)
- Last Synced: 2025-03-22T06:45:44.167Z (about 1 year ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsdoc-tsmd
A [JSDoc](https://jsdoc.app/) template for small projects that can emit Markdown docs or TypeScript types.
Not really recommended for use as it only implements the few parts of JSDoc that the author has use for. Likely the project will die as TS tooling gets better over time.
## Setting up
Set this up like any other JSDoc template. Start by installing the package:
```sh
npm i -D @borgar/jsdoc-tsmd
```
Then add a config file, which it might look something like this:
```json
{
"source": {
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "((^|\\/|\\\\)_|spec\\.js$)"
},
"opts": {
"template": "node_modules/@borgar/jsdoc-tsmd",
"destination": "console",
}
}
```
Running `jsdoc -c myconfig.json src` should then emit some Markdown docs (given that the sources have valid jsdoc comments in them). See the options below for how do produce TypeScript type declarations.
#### Options:
Generally, refer to JSDoc's [documentation on how to configure it](https://jsdoc.app/about-configuring-jsdoc.html) but these options have special meaning here:
* `destination` - Where to save the emitted text, using `"console"` will log the output to the console.
* `output` - Set this to `"typescript"` to emit TypeScript type declarations rather than Markdown docs.
* `validate` - When producing type declarations, the output will be run through TypeScript to validate it, if you like living on the edge, you can set this to `false` to skip this step.
## License
[MIT](LICENSE)