UNPKG

5.66 kBMarkdownView Raw
1
2# TypeScript
3
4[![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)
5[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript)
6[![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)
7[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
8[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
9
10
11
12[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/typescript).
13
14## Installing
15
16For the latest stable version:
17
18```bash
19npm install -g typescript
20```
21
22For our nightly builds:
23
24```bash
25npm install -g typescript@next
26```
27
28## Contribute
29
30There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
31* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
33* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
34* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
35* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md).
36* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
37 [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)).
38
39This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
40the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
41with any additional questions or comments.
42
43## Documentation
44
45* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
46* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
47* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)
48* [Homepage](https://www.typescriptlang.org/)
49
50## Building
51
52In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
53
54Clone a copy of the repo:
55
56```bash
57git clone https://github.com/microsoft/TypeScript.git
58```
59
60Change to the TypeScript directory:
61
62```bash
63cd TypeScript
64```
65
66Install [Gulp](https://gulpjs.com/) tools and dev dependencies:
67
68```bash
69npm install -g gulp
70npm install
71```
72
73Use one of the following to build and test:
74
75```
76gulp local # Build the compiler into built/local.
77gulp clean # Delete the built compiler.
78gulp LKG # Replace the last known good with the built one.
79 # Bootstrapping step to be executed when the built compiler reaches a stable state.
80gulp tests # Build the test infrastructure using the built compiler.
81gulp runtests # Run tests using the built compiler and test infrastructure.
82 # Some low-value tests are skipped when not on a CI machine - you can use the
83 # --skipPercent=0 command to override this behavior and run all tests locally.
84 # You can override the specific suite runner used or specify a test for this command.
85 # Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
86 # Valid runners include conformance, compiler, fourslash, project, user, and docker
87 # The user and docker runners are extended test suite runners - the user runner
88 # works on disk in the tests/cases/user directory, while the docker runner works in containers.
89 # You'll need to have the docker executable in your system path for the docker runner to work.
90gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
91 # core count by default. Use --workers=<number> to adjust this.
92gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
93gulp lint # Runs eslint on the TypeScript source.
94gulp help # List the above commands.
95```
96
97
98## Usage
99
100```bash
101node built/local/tsc.js hello.ts
102```
103
104
105## Roadmap
106
107For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).