flow

How to use the flow transformer.

The flow transformer is responsible for stripping flow nodes and type annotations from your code.

Example

In

function foo(one: any, two: number, three?): string {}

Out

function foo(one, two, three) {}

Blacklisting

For one reason or another you may want flow nodes and type annotations to be retained. You can do this by blacklisting the flow transformer:

require("babel").transform("code", { blacklist: ["flow"] });
$ babel --blacklist flow script.js