Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Latest commit

 

History

History

js-and-ts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

TypeScript Sample: Mixing TypeScript and JavaScript

Overview

A sample of how to use the allowJS option to use both JavaScript and TypeScript together. A simple text formatter is provided, written in JavaScript. This formatter is then used within a TypeScript class to format a computation.

To run this sample, you must have node installed. You can also use ts-node to run this directly without a compilation from TypeScript to JavaScript.

Running

$ tsc robot.ts`
$ node robot.js`