$ npm install babel-plugin-syntax-flow
.babelrc
{ "plugins": ["syntax-flow"] }
$ babel --plugins syntax-flow script.js
require("babel-core").transform("code", { plugins: ["syntax-flow"] });