This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file from the command line.

install:

  1. npm install -g typescript
  2.  
  3. tsc -v // version

app.ts:

  1. class Person{}

RUN:

  1. tsc app.ts

You will see the js file with the same name.

If you want a different name, you can do :

  1. tsc --out <output_filename> <input_filename>
  2.  
  3. tsc --out bundle.js app.ts

Watch files changes:

  1. tsc -w --out bundle.js app.ts

[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)的更多相关文章

  1. 玩转TypeScript(引言&文章目录) --初看TypeScript.

    JavaScript过去一直被当作一种玩具语言存在,直到2005年以后,这门语言又开始活跃并可以说是火爆,而且随着浏览器版本的不断升级和完善,各种DOM之间的兼容性已经渐渐的被各种技术解决了,比如经典 ...

  2. electron教程(番外篇二): 使用TypeScript版本的electron, VSCode调试TypeScript, TS版本的ESLint

    我的electron教程系列 electron教程(一): electron的安装和项目的创建 electron教程(番外篇一): 开发环境及插件, VSCode调试, ESLint + Google ...

  3. [Typescript] Installing Promise Type Definitions Using the lib Built-In Types

    To fix Promise is not recolized in TypeScript, we can choose to use a lib: npm i @types/es6-promise ...

  4. [TypeScript] 1. Catching JavaScript Mistakes with TypeScript

    The TypeScript compiler is a powerful tool which catches mistakes even in vanilla JavaScript. Try it ...

  5. [TypeScript] Work with DOM Elements in TypeScript using Type Assertions

    The DOM can be a bit tricky when it comes to typing. You never really know exactly what you're going ...

  6. [TypeScript] The Basics of Generics in TypeScript

    It can be painful to write the same function repeatedly with different types. Typescript generics al ...

  7. [TypeScript] Dynamically initialize class properties using TypeScript decorators

    Decorators are a powerful feature of TypeScript that allow for efficient and readable abstractions w ...

  8. TypeScript完全解读(26课时)_1.TypeScript完全解读-开发环境搭建

    1.TypeScript完全解读-开发环境搭建 初始化项目 手动创建文件夹 D:\MyDemos\tsDemo\client-demo 用VSCode打开 npm init:初始化项目 然后我们的项目 ...

  9. TypeScript完全解读(26课时)_2.TypeScript完全解读-基础类型

    2.TypeScript完全解读-基础类型 src下新建example文件夹并新建文件.basic-type.ts.截图中单词拼错了.后需注意一下是basic-type.ts 可以装tslint的插件 ...

随机推荐

  1. Java多线程初学者指南(8):从线程返回数据的两种方法

    从线程中返回数据和向线程传递数据类似.也可以通过类成员以及回调函数来返回数据.但类成员在返回数据和传递数据时有一些区别,下面让我们来看看它们区别在哪. 一.通过类变量和方法返回数据 使用这种方法返回数 ...

  2. 【JavaScript】JavaScript函数的参数

    要访问js函数中传入的所有参数,可以使用特殊的arguments变量.但是虽然可以像访问数组一样从arguments变量中读取参数,但arguments并非真正的数组.例如,arguments没有pu ...

  3. js template

    http://garann.github.io/template-chooser/ http://www.gbin1.com/technology/javascript/20120917-javasc ...

  4. spring 属性配置细节

    1.使用构造器注入属性值可以指定参数的位置和参数的类型!以区分重载的构造器.例如:<constructor-arg value="" type="java.lang ...

  5. 纯手工全删除域内最后一个EXCHANGE--How to Manually Uninstall Last Exchange 2010 Server from Organization

    http://www.itbigbang.com/how-to-manually-uninstall-last-exchange-2010-server-from-organization/ 没办法, ...

  6. ASP.NET MVC 增强Convert用法+【分页2】

    [分页2]    public dynamic PageQuery()        {              :  : ; i < data.Length; i++)            ...

  7. Hadoop RPC源码阅读-服务端Server

    Hadoop版本Hadoop2.6 RPC主要分为3个部分:(1)交互协议 (2)客户端(3)服务端 (3)服务端 RPC服务端的实例代码: public class Starter { public ...

  8. jBPM 4.4 数据库设计

    1         存储流程定义相关的部署信息数据库 1.1              jbpm4_deployment 字段名 字段含义 类型 允许空值 键 DBID_ 流程模板标识 Bigint( ...

  9. FusionCharts 3.2.1 flash 图表展示、数据钻取

    StackedColumn3DLineDY.swf 效果展示: 一.页面代码 <div id="chart2div" align="center" sty ...

  10. [App]Taste VS2015 && Android Studio

    逆水飞 尝试进行各种Android开发工具的安装以及大致流程对比 几个疑惑的地方 1)根据SDK的描述,应该是一个新版本的推出就有对应的包里面包含多个文件那么对于:SDK Platform.APIs. ...