babel-preset-typescript

Babel preset for TypeScript.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-preset-typescript
7.0.0-alpha.196 years ago6 years agoMinified + gzip package size for babel-preset-typescript in KB

Readme

babel-preset-typescript
Babel preset for TypeScript.

This preset includes the following plugins:

Example

In
const x: number = 0;

Out
const x = 0;

Installation

npm install --save-dev babel-preset-typescript

Usage

Via .babelrc (Recommended)

.babelrc
{
  "presets": ["typescript"]
}

Via CLI

babel --presets typescript script.ts

Via Node API

require("babel-core").transform("code", {
  presets: ["typescript"]
});