Convert Thrift definitions to Flowtype declarations

Usage no npm install needed!

<script type="module">
  import thrift2flow from '';



Build status

Automagically converts Apache Thrift specs to Flowtype type definition files!

NOTE: This library tries to align with the thriftrw JS semantics which means it may not be compatible with generated code from the apache thrift project.


typedef string UUID

struct Customer {
  1: UUID id
  2: string name
  3: i32 age
  4: list<string> tags


export type UUID = string;

export type Customer = {
  id: UUID,
  name: string,
  age: number,
  tags: string[],

Installation and Usage

npm install -g thrift2flow
thrift2flow --path="idl/" --outputDir="src/types/idl" idl/*/*/*.thrift


We'd love for you to contribute to this project. Before we can accept your contributions, we kindly ask you to sign our Uber Contributor License Agreement.

  • If you find a bug, please open an issue, or submit a fix via a pull request
  • If you have a feature request, open an issue, or submit an implementation via a pull request
  • If you want to contribute, submit a pull request