npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

babel-plugin-flow-prepack

0.13.0

@codemix

npmHomeRepoSnykSocket
Downloads:1
$ npm install babel-plugin-flow-prepack
DailyWeeklyMonthlyYearly

Babel Plugin Flow Prepack

A babel plugin which transforms Flow annotations into prepack model declarations.

What?

Turns code like this:


type Status = string;

declare var someGlobal: {
  foo: number,
  bar: string,
  status: Status
};

Into code like this:

const Status = 'string';
__assumeDataProperty(global, 'someGlobal', __abstract({
  foo: __abstract('number'),
  bar: __abstract('string'),
  status: __abstract(Status)
}))

So that you can use Flow type annotations to give type hints to prepack.

Installation

npm install --save-dev babel-plugin-flow-prepack

Next, add the following to your babel configuration or .babelrc:

{
  "plugins": ["flow-prepack"]
}