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

install:

npm install -g typescript

tsc -v // version 

app.ts:

class Person{}

RUN:

tsc app.ts

You will see the js file with the same name.

If you want a different name, you can do :

tsc --out <output_filename> <input_filename>

tsc --out bundle.js app.ts

Watch files changes:

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. leetcode 第一题 Two Num java

    Given an array of integers, find two numbers such that they add up to a specific target number. The ...

  2. 意犹未尽而来的第一篇Android 逆向

    游戏:咕噜王国大冒险 平台:android 目标: 1. 去除乱七八糟提示(本篇目标) 2. 去除google弹窗 3. 破解“all stages” 破文开始: 1. 使用APKIDE反编译:搜索字 ...

  3. VC释放EXE资源文件

    原文地址:http://blog.csdn.net/wangningyu/article/details/4378378 今天有个朋友问到VC能否释放多个EXE.DLL或WAV等文件,我便做了个实例给 ...

  4. Android 获取手机联系人信息

    //获取联系人 Uri rawContacts = Uri.parse("content://com.android.contacts/raw_contacts"); Conten ...

  5. [LeetCode] Burst Balloons (Medium)

    Burst Balloons (Medium) 这题没有做出来. 自己的思路停留在暴力的解法, 时间复杂度很高: 初始化maxCount = 0. 对于当前长度为k的数组nums, 从0到k - 1逐 ...

  6. 手机归属地查询-IP地址查询-身份证查询-域名备案查询--Api接口

    使用这些接口是需要密钥的 公共密钥 appkey: 10003  secret: d1149a30182aa2088ef645309ea193bf  生成后sign: b59bc3ef6191eb9f ...

  7. Python之re模块

    参考:http://www.cnblogs.com/PythonHome/archive/2011/11/19/2255459.html 这个模块提供了与 Perl 相似l的正则表达式匹配操作.Uni ...

  8. -_-#【video】

    视频 HTML5 视频 HTML5的视频格式之争 移动端HTML5<video>视频播放优化实践 后备

  9. 【转】从QA到EP

    从QA到EP 两三年以前,和友人谈到 QA(软件质量保证) 这个行业,还有 QA 这个团队的未来,就有了一丝忧虑.而现在,终于有机会实践一下自己之前的想法,在这里分享给大家. 从我有限的从业经验到现在 ...

  10. 算法 python实现(三) 快速排序

    算法学起来真费劲啊,智商只够捉只鸡的.昨晚没看明白就没电了,过两天要考虑偷电了... 今天看看快速排序,有一个博客写的很好,通俗生动形象,适合我这样的算法大白菜.推荐一下 http://www.cnb ...