Adds static typing to JavaScript to improve developer productivity and code quality. https://flow.org/
Find a file
Sam Zhou 2ce00d9daf [flow][oxidation] Additional ptr_eq optimizations
Summary: Changelog: [internal]

Reviewed By: marcoww6

Differential Revision: D97326170

fbshipit-source-id: b0320254d056d4d22c3bf345051b8d99325f053c
2026-03-19 12:35:11 -07:00
.circleci [flow][dev-tools] Add flow-upgrade to deploy_npm.sh 2026-01-30 00:25:46 -08:00
.github [flow][ci] Add fallback Cygwin mirrors for Windows build 2026-02-13 13:38:23 -08:00
github [Codemod][TP2][Multi-Versioning] Update set_cfg_modifiers load in fbcode/flow 2025-07-08 11:35:23 -07:00
lib [flow][core.js] Accept readonly tuples in Map constructor 2026-03-11 12:30:56 -07:00
newtests [flow] Add LSP test for deprecated colon type parameter autofix 2026-03-05 19:00:05 -08:00
packages [flow] Add Node.js check-test runner to replace bash runtests.sh 2026-03-18 16:12:17 -07:00
prelude [flow] Model $FlowFixMe as a builtin type 2025-08-22 06:05:47 -07:00
resources/shell [PR] Publish Windows binary from Circle, remove Appveyor 2020-01-14 07:56:57 -08:00
rust_port [flow][oxidation] Additional ptr_eq optimizations 2026-03-19 12:35:11 -07:00
scripts [flow][oxidation] Infra to support rust port test override 2026-03-04 09:55:53 -08:00
src [flow][tslib] Support type keywords in dotted type access 2026-03-19 00:07:06 -07:00
tests [flow][tslib] Support type keywords in dotted type access 2026-03-19 00:07:06 -07:00
website [flow] v0.306.0 2026-03-18 12:28:01 -07:00
.gitattributes Treat *.ml{i} in Linguist as OCaml 2022-11-21 21:56:04 -08:00
.gitignore fix: space out properly and rearrange into section 2023-01-19 11:44:35 -08:00
.merlin consolidate .merlin files 2019-06-28 16:54:20 -07:00
.ocamlformat Bump ocamlformat to latest 0.24.1 2023-01-03 17:05:03 -08:00
Changelog.md [flow] v0.306.0 2026-03-18 12:28:01 -07:00
CODE_OF_CONDUCT.md Adopt Contributor Covenant 2019-08-29 23:26:30 -07:00
CONTRIBUTING.md [ez] Update CONTRIBUTING.md 2022-11-07 11:13:42 -08:00
dune [flow] Switch dune build to ocaml 5.2 (#9170) 2024-06-21 16:39:47 -07:00
dune-project sync js_of_ocaml dune and ocamlbuild flags 2022-11-17 20:02:04 -08:00
dune-workspace build flow.js with dune 2022-11-25 11:03:54 -08:00
flow_parser.opam [flow] v0.306.0 2026-03-18 12:28:01 -07:00
flowtype.opam [flow] v0.306.0 2026-03-18 12:28:01 -07:00
LICENSE [codemod] Update copyright headers from Facebook to Meta 2021-12-30 14:57:56 -08:00
Makefile [tests] Explicitly pass --yes for ounit install step (#9243) 2025-01-06 09:45:04 -08:00
package.json [flow] Disconnect flow-parser from the rest of the root workspace 2023-11-03 15:17:42 -07:00
README.md [flow][docs] Update test docs 2025-12-01 13:59:53 -08:00
runtests.sh [flow][oxidation] Infra to support rust port test override 2026-03-04 09:55:53 -08:00
tool remove babel from flow-dev-tools 2021-09-30 14:40:01 -07:00
yarn.lock [hermes-parser] Update hermes-parser and related packages in flow to 0.34.0 2026-03-16 20:15:38 -07:00

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:

  • macOS (x86_64)
  • Linux (x86_64 and arm64)
  • Windows (x86_64, Windows 10 recommended)

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

While Flow is written in OCaml, its 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 OCaml (OCaml 5.2.0 is required).

  1. Install system dependencies:

    • Mac: brew install opam

    • Debian: sudo apt-get install opam

    • Other Linux: see opam docs

    • Windows: cygwin and a number of dependencies like make, gcc and g++ are required.

      One way to install everything is to install Chocolatey and then run .\scripts\windows\install_deps.ps1 and .\scripts\windows\install_opam.ps1. Otherwise, see the "Manual Installation" section of OCaml for Windows docs and install all of the packages listed in our install_deps.ps1.

      The remainder of these instructions should be run inside the Cygwin shell: C:\tools\cygwin\Cygwin. Then cd /cygdrive/c/Users/you/path/to/checkout.

  2. Validate the opam version is 2.x.x:

    opam --version
    

    The following instructions expect 2.x.x. Should your package manager have installed a 1.x.x version, please refer to the opam docs to install a newer version manually.

  3. Initialize opam:

    # on Mac and Linux:
    opam init
    
    # on Windows:
    scripts/windows/init_opam.sh
    
  4. Install Flow's OCaml dependencies:

    # from within this git checkout
    make deps
    

    note: If you find that you get an error looking for ocaml-base-compiler version, your local dependency repo may be out of date and you need to run opam update + opam upgrade

  5. Build the flow binary:

    eval $(opam env)
    make
    

    This produces the bin/flow binary.

  6. Build flow.js (optional):

    opam install -y js_of_ocaml.5.7.2
    make js
    

    This produces bin/flow.js.

    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).