@jackcannon/ts-to-jsdoc

1.3.3 • Public • Published

TypeScript to JSDoc

Transpile TypeScript code annotated with JSDoc to fully compatible JavaScript code, preserving your documentation.

Usage

Command Line

$ ts-to-jsdoc

Usage:
  ts-to-jsdoc [options] <path>...

Options:
  -h --help          Shows this.
  -o --out --output  Directory to output transpiled JavaScript. [default: source path]
  -i --ignore        File or directory paths to ignore when transpiling.
  -f --force         Overwrite existing output files.

Node.js

const transpile = require("ts-to-jsdoc");
// or
import transpile from "ts-to-jsdoc";

const code = `
/**
 * Does stuff.
 * @param param It's a parameter.
 */
function doStuff(param: string): number {}
`;

const transpiledCode = transpile(code);
// Output:
// /**
//  * Does stuff.
//  * @param {string} param It's a parameter.
//  * @returns {number}
//  */
// function doStuff(param) {}

License

MIT © futurGH.

Package Sidebar

Install

npm i @jackcannon/ts-to-jsdoc

Weekly Downloads

1

Version

1.3.3

License

MIT

Unpacked Size

23.7 kB

Total Files

8

Last publish

Collaborators

  • jackcannon