UNPKG

4.89 kBMarkdownView Raw
1[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
2[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs)
3[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
4[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
5
6# TypeScript
7
8[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
10[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
11
12## Installing
13
14For the latest stable version:
15
16```bash
17npm install -g typescript
18```
19
20For our nightly builds:
21
22```bash
23npm install -g typescript@next
24```
25
26## Contribute
27
28There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
29* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
30* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
31* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
32* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
33* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
34* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
35 [pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)).
36
37This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
38the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
39with any additional questions or comments.
40
41## Documentation
42
43* [Quick tutorial](https://www.typescriptlang.org/docs/tutorial.html)
44* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
45* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
46* [Homepage](https://www.typescriptlang.org/)
47
48## Building
49
50In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
51
52Clone a copy of the repo:
53
54```bash
55git clone https://github.com/Microsoft/TypeScript.git
56```
57
58Change to the TypeScript directory:
59
60```bash
61cd TypeScript
62```
63
64Install [Gulp](https://gulpjs.com/) tools and dev dependencies:
65
66```bash
67npm install -g gulp
68npm install
69```
70
71Use one of the following to build and test:
72
73```
74gulp local # Build the compiler into built/local
75gulp clean # Delete the built compiler
76gulp LKG # Replace the last known good with the built one.
77 # Bootstrapping step to be executed when the built compiler reaches a stable state.
78gulp tests # Build the test infrastructure using the built compiler.
79gulp runtests # Run tests using the built compiler and test infrastructure.
80 # You can override the host or specify a test for this command.
81 # Use --host=<hostName> or --tests=<testPath>.
82gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
83 parameters '--host=', '--tests=[regex], --reporter=[list|spec|json|<more>]'.
84gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
85gulp lint # Runs tslint on the TypeScript source.
86gulp help # List the above commands.
87```
88
89
90## Usage
91
92```bash
93node built/local/tsc.js hello.ts
94```
95
96
97## Roadmap
98
99For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap).