flow README

The project's README from github.com/facebook/flow. As one markdown file: README.md.

Flow

CircleCI Follow @flowtype MIT License GitHub contributors GitHub top language Join Discord Chat

Flow is a static typechecker for JavaScript. To find out more about Flow, check out flow.org.

Contents

Requirements

Flow works with:

There are binary distributions for each of these platforms and you can also build it from source on any of them as well.

Using Flow

Check out the installation instructions, and then the usage docs.

Using Flow's parser from JavaScript

Flow's parser is available as a compiled-to-JavaScript module published to npm, named flow-parser. Most end users of Flow will not need to use this parser directly, but JavaScript packages which make use of parsing Flow-typed JavaScript can use this to generate Flow's syntax tree with annotated types attached.

Building Flow from source

Flow is written in Rust. GitHub CI builds Flow from the rust_port workspace with nightly Rust.

  1. Install system dependencies:

    • Install Rust via rustup.

    • Install the nightly Rust toolchain:

      rustup toolchain install nightly
      
  2. Build the Rust workspace:

    cd rust_port
    cargo +nightly build
    
  3. Run the Rust tests:

    cargo +nightly test
    
  4. Build an optimized flow binary:

    cargo +nightly build --release --bin flow_cli
    
  5. Build flow.js (optional):

    The flow.js build also uses the Rust port. Install Emscripten, Node, Yarn, and a Rust nightly toolchain with the wasm32-unknown-emscripten target and rust-src component first. GitHub CI uses Emscripten 3.1.44 and nightly Rust for this build.

    rustup toolchain install nightly-2026-04-14 --target wasm32-unknown-emscripten --component rust-src
    RUSTUP_TOOLCHAIN=nightly-2026-04-14 make js FLOW_JS_IMPL=rust-wasm
    

    This produces bin/flow.js.

    To build a faster, larger local development version instead, run:

    RUSTUP_TOOLCHAIN=nightly-2026-04-14 make js FLOW_JS_IMPL=rust-wasm FLOW_DOT_JS_WASM_PROFILE=dev
    

    The Flow parser can also be compiled to JavaScript. Read how here.

Running the tests

See tests/README.md for detailed testing documentation.

Join the Flow community

License

Flow is MIT-licensed (LICENSE). The website and documentation are licensed under the Creative Commons Attribution 4.0 license (website/LICENSE-DOCUMENTATION).

flow (facebook/flow)

Searching Database…

22.3K ·GitHub
What is this?Flow is a static typechecker for JavaScript: it adds static typing to your code to catch errors early and improve quality. The project goes back to 2014 and is written in Rust.
Is it a library I import, or a command-line tool?It's a command-line tool: you run the flow binary against your codebase and it reports type errors. Nothing to import — you just annotate your JavaScript.
How do I get it running?Follow the installation instructions at flow.org, then the usage docs. Prebuilt binaries exist for every supported platform, so a typical setup needs no compiling.
Do I need Node or any other runtime installed to run it?Just the binary — no Node, Python or other runtime required. Node, Yarn and Emscripten only come into play if you build the optional flow.js from source.
Which systems can run it — will an Intel Mac work?macOS (arm64), Linux (x86_64 or arm64) and Windows (x86_64, Windows 10 recommended). Intel Macs aren't in the supported list, so there you'd have to build from source yourself.
Can I use it in commercial projects?Yes: Flow is MIT-licensed, so commercial use is fine. The website and docs are separately under Creative Commons Attribution 4.0.
Can my own tooling parse Flow-typed code?Yes — flow-parser is a compiled-to-JavaScript npm module that produces Flow's syntax tree with annotated types attached. It's meant for tooling authors; most end users never touch it directly.
Is there a JavaScript build of the checker itself?Yes: an optional flow.js build compiles the Rust code with Emscripten into bin/flow.js (needs Node, Yarn, Emscripten and nightly Rust with the wasm32-unknown-emscripten target). A faster but larger local dev build is also documented.
Is Flow still actively maintained?It looks that way: the repo was created in October 2014, has about 22k stars, isn't archived, and its CI still runs build-and-test workflows. There's an active community on Discord, IRC and Stack Overflow.
Creator
facebook
Size
184 MB
Stars
22.3K
Age
11y
Commits · 90 Days