babel-preset-typescript
v7.0.0-alpha.19
Published
Babel preset for TypeScript.
Downloads
14,191
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"]
});