Tiny-Typescript-Transpiler is a simple learning library for transpilers like swc, excluding binder and checker.
Important
This library is only for learning the overview of transpiler.
This library is designed as a simplified learning tool for understanding how transpilers like swc work. It does not include the complexity of binders and checkers.
- string
- number
- boolean
- undefined
- null
- symbol
- bigint
- Boolean literals
- Numeric literals
- RegExp literals
- String literals
- Object literals
- Array literals
- Floating-point literals
- CallExpression: Support for
fn()
- FunctionDeclaration: Support for
function alertMessage (message: string) { alert(message); }
- TypeAliasDeclaration: Support for
type str = string;
- VariableDeclaration: Support for
const hi: str = "hello";
- BinaryExpression: Support for binary operations like 1 + 1 or foo - bar.
- UnaryExpression: Support for unary operations like !true or -1.
- IfStatement: Support for if, else if, and else statements.
- SwitchStatement: Support for switch statements.
- ForStatement: Support for for loop.
- WhileStatement: Support for while loop.
- DoWhileStatement: Support for do while loop.
- ArrayLiteralExpression: Support for array literals like [1, 2, 3].
- ObjectLiteralExpression: Support for object literals like { foo: 'bar' }.
- ClassDeclaration: Support for class definitions.
- InterfaceDeclaration: Support for interface definitions.
- EnumDeclaration: Support for enum definitions.
- ModuleDeclaration: Support for module definitions.
- ImportDeclaration: Support for import statements.
- ExportDeclaration: Support for export statements.
- ArrowFunction: Support for arrow functions.
- TemplateLiteral: Support for template literals.
- OptionalChaining: Support for optional chaining.
- NullishCoalescing: Support for nullish coalescing.
- Comment
- Transpiler Options
To use the Tiny-Typescript-Transpiler, use the following command:
ttt [OPTIONS] <FILE_PATH>
- <FILE_PATH>: The path to the file you want to transpile.
- -d, --debug: Enable debug mode.
- -h, --help: Print help information.