Skip to content

Flow

A static type checker that finds type errors in JavaScript code before it runs.

Stars
22.3k
Forks
1.9k
Licence
MIT
Language
Rust
Last update
4 days ago
Type
Dev tool

What it is

Flow is a static typechecker for JavaScript, developed by Meta. It reads JavaScript code that has type annotations and reports mismatches, such as passing the wrong kind of value to a function, without running the code. Developers use it to catch bugs earlier and to make large JavaScript codebases easier to understand and change.

  • Add type annotations to a JavaScript file and run Flow to find mismatched types
  • Check a large codebase for type errors as part of a build or CI pipeline
  • Use the flow-parser npm package to parse Flow-typed JavaScript in another tool

Great for

  • JavaScript developers who want type checking without rewriting their code in another language
  • Teams maintaining large JavaScript codebases that benefit from typed interfaces
  • Developers on macOS, Linux, or Windows who want a prebuilt binary
  • Developers who want to check code in an editor or in CI, as the README describes running the flow binary

Not ideal for

  • Projects that already standardized on TypeScript and its tooling, since switching costs time and Flow has a different ecosystem (reason: the README does not compare the two)
  • Beginners with no JavaScript experience, since the tool assumes familiarity with type annotations (reason: the README gives little introductory material and links to external docs)
  • People who want to build Flow themselves on an unsupported platform, since the README lists only macOS arm64, Linux x86_64 and arm64, and Windows x86_64 (reason: limited platform list)
Step-by-step guide: how to use FlowInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Rust with rustup (only needed to build from source) · Nightly Rust toolchain (only needed to build from source)

    Install nightly Rust toolchain (build from source)

    rustup toolchain install nightly

    Build the Rust workspace

    cd rust_port && cargo +nightly build

    Build an optimized flow binary

    cargo +nightly build --release --bin flow_cli
  2. 2

    Run it

    • Install Flow using the instructions at flow.org/en/docs/getting-started (the README links there for installation)
    • Add type annotations to a JavaScript file
    • Run Flow from your project directory and read the reported errors
    • Fix the reported issues and run Flow again
  3. 3

    Get the most out of it

    • Follow the installation and usage docs at flow.org for the current recommended setup
    • Use the flow-parser npm package if you are building a tool that needs Flow's syntax tree
    • Build the optional flow.js version if you need Flow to run in JavaScript environments
    • Join the Discord or Stack Overflow flowtype tag to get help

Downloads

Strengths

  • Developed and maintained by Meta with a large community and about 22,000 GitHub stars
  • Prebuilt binaries are provided for major platforms, so installation does not require building from source
  • Released under the permissive MIT license

Trade-offs

  • The README is truncated and gives few concrete usage examples; detailed setup is delegated to flow.org
  • Building from source requires a nightly Rust toolchain and, for the JavaScript build, Emscripten, Node, and Yarn
  • The README mentions a Rust port in progress, so parts of the build process may change

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.