explaingit

facebook/flow

Analysis updated 2026-06-21

22,207RustAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Flow is a static type checker for JavaScript that catches type errors during development before your code runs, acting like an automated proofreader that flags inconsistencies in how data flows through your codebase.

Mindmap

mindmap
  root((flow))
    What it does
      Checks types before runtime
      Infers types automatically
      Reports type mismatches
    Tech stack
      Written in OCaml
      JS parser npm package
      Background server
    Use cases
      Catch bugs early
      Safer refactoring
      Editor integration
    Audience
      JS developers
      Large codebases
      Teams wanting type safety
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add optional type annotations to an existing JavaScript project so Flow can catch bugs like passing a string where a number is expected

USE CASE 2

Integrate Flow into your editor or CI pipeline for real-time type error feedback as you write code

USE CASE 3

Use the flow-parser npm package to parse Flow-typed JavaScript from within your own JavaScript tooling

What is it built with?

OCamlJavaScriptRust

How does it compare?

facebook/flowrustpython/rustpythonslint-ui/slint
Stars22,20722,03522,508
LanguageRustRustRust
Setup difficultymoderatehardmoderate
Complexity3/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires installing the Flow binary and adding @flow comments to each file you want checked.

Licensed under MIT, use freely for any purpose, including commercial projects, as long as you include the copyright notice.

In plain English

Flow is a static type checker for JavaScript, a tool that reads your JavaScript code and checks for type errors before you run it. JavaScript is a dynamically typed language, meaning that mistakes like passing a text string where a number is expected often only surface as errors at runtime. Flow catches those mistakes during development, acting like an automated proofreader that spots inconsistencies in how data flows through your code. Flow adds an optional layer of type annotations to JavaScript. You can label variables, function parameters, and return values with their expected types (for example, indicating that a function should always receive a number and return a string). Flow then analyzes the code and reports anywhere these expectations are violated, even in code paths you haven't explicitly annotated, because it infers types from how values are used. The tool runs as a background server that monitors your files, so it can give you feedback quickly as you edit. You interact with it through a command-line tool or through editor integrations. The codebase itself is written in OCaml (a statically typed programming language well-suited for compilers and analysis tools), and pre-built binaries are available for macOS, Linux (both x86_64 and arm64), and Windows. For projects that need to parse Flow-typed JavaScript from within a JavaScript environment, the parser is separately published as an npm package called flow-parser. You would use Flow on a JavaScript codebase where you want the safety benefits of type checking, catching bugs early, improving code readability, and making refactoring safer, without switching to a different language. Flow is licensed under MIT.

Copy-paste prompts

Prompt 1
I have a JavaScript function that takes a user object and returns a formatted greeting. Show me how to add Flow type annotations so it catches wrong field types.
Prompt 2
How do I set up Flow in an existing JavaScript project and run it from the command line to see all current type errors?
Prompt 3
Write a Flow-typed React component that accepts a typed list of items as a prop and renders them, show me the annotation syntax.
Prompt 4
How do I tell Flow to ignore a specific file or third-party library that has no type definitions?
Prompt 5
What is the difference between Flow and TypeScript, and when would I choose Flow for a JavaScript project?

Frequently asked questions

What is flow?

Flow is a static type checker for JavaScript that catches type errors during development before your code runs, acting like an automated proofreader that flags inconsistencies in how data flows through your codebase.

What language is flow written in?

Mainly Rust. The stack also includes OCaml, JavaScript, Rust.

What license does flow use?

Licensed under MIT, use freely for any purpose, including commercial projects, as long as you include the copyright notice.

How hard is flow to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is flow for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub facebook on gitmyhub

Verify against the repo before relying on details.