Skip to content

Transpile TypeScript code to fully compatible JavaScript + JSDoc comments.

License

Notifications You must be signed in to change notification settings

Kokujou/ts-to-jsdoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript to JSDoc

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

A NOTE

This program's primary purpose is to transpile TypeScript so that it can be used with documentation generators that expect JavaScript code. Any other use case is not intended and unsupported. (though I would love to see how else this can be used!)

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.

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.

About

Transpile TypeScript code to fully compatible JavaScript + JSDoc comments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%