2.4.0 • Published 9 months ago
ts-to-jsdoc v2.4.0
TypeScript to JSDoc
Transpile TypeScript code annotated with JSDoc to fully compatible JavaScript code, preserving your documentation.
Demo by @smacpherson64: TypeScript to JSDoc
Usage
Command Line
$ ts-to-jsdoc
Usage:
ts-to-jsdoc [options] <path>...
ts-to-jsdoc -p path/to/tsconfig.json
Options:
-h --help Shows this.
-p --project Path to tsconfig.json.
-o --out --output Directory to output transpiled JavaScript. [default: source path, ignored if project is set]
-i --ignore File or directory paths to ignore when transpiling. [ignored if project is set]
-f --force Overwrite existing output files. [ignored if project is set]
Node.js
const { transpileFile, transpileProject } = require("ts-to-jsdoc");
// or
import { transpileFile, transpileProject } from "ts-to-jsdoc";
const code = `
/**
* Does stuff.
* @param param It's a parameter.
*/
function doStuff(param: string): number { }
`;
const transpiledCode = transpileFile({ code: code });
// Output:
// /**
// * Does stuff.
// * @param {string} param It's a parameter.
// * @returns {number}
// */
// function doStuff(param) { }
/* Or you can transpile an entire project at once */
transpileProject({ project: "path/to/tsconfig.json" });
License
2.3.0
10 months ago
2.4.0
9 months ago
2.3.1
9 months ago
2.1.2
11 months ago
2.2.0
10 months ago
2.1.0
1 year ago
2.0.0
1 year ago
1.6.1
1 year ago
1.6.0
1 year ago
1.5.2
1 year ago
1.5.1
1 year ago
1.5.0
2 years ago
1.4.0
2 years ago
1.3.1
2 years ago
1.2.2
2 years ago
1.3.0
2 years ago
1.2.1
2 years ago
1.2.0
3 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago