Skip to content
Adds static typing to JavaScript to improve developer productivity and code quality.
OCaml JavaScript C Shell Makefile Standard ML Other
Latest commit 5b019fc @mroch mroch committed with Facebook Github Bot 2 add --ignore-version flag to status and check
Summary:i'm tired of updating the .flowconfig to test dev versions :)

this moves the version check from the parsing of the flowconfig to when actually starting the server. this also opens the ability to add a `--version` flag to `flow init`, but I didn't do that yet because I'm not sure it should be its own flag (and its own .flowconfig section), or if we should make it part of `[options]` and therefore the `--options` flag.

Reviewed By: samwgoldman

Differential Revision: D3077339

fb-gh-sync-id: e4e3744f91e833dda3a6912f43c04cc74a7f4375
shipit-source-id: e4e3744f91e833dda3a6912f43c04cc74a7f4375
Failed to load latest commit information.
examples [flow docs] Main page, "Getting Started", & "Five Simple Examples" re…
hack Add missing OCaml C runtime macros, occasional style changes as well
js alpha-quality flow.js
lib Add missing declarations to builtins.
resources use fake email for doc pushes
scripts Updated all copyright license headers
src add --ignore-version flag to status and check
tests add --ignore-version flag to status and check
website Fix typo in builtins.doc.js
.flowconfig Sync changes to upstream
.gitignore Add React docs
.merlin Adds merlin file configuration
.travis-ci.sh reduce parallelism on travis linux builds
.travis.yml [travis] move opam/ocaml installation to install phase
00_config.ocp Update build system and some fixes on the test-suite on Windows
CONTRIBUTING.md Add contributing rules
Changelog.md Add missing declarations to builtins.
LICENSE Updated all copyright license headers
Makefile [easy] add flow.js target to Makefile
PATENTS Sync changes to upstream
README.md Update opam instructions to use depext
README.win32 Update build system and some fixes on the test-suite on Windows
_tags [cleanup] fix all the ocaml warnings
build.ocp move 'port' command code around
flow-types.el unbreak emacs support
make.bat Add build.ocp to compile Flow with ocp-build.
runtests.sh Fix --strip-root for new error format & add "pretty" field to error json

README.md

Flow Build Status

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

For a background on the project, please read our launch blog post.

Requirements

Flow works with:

  • Mac OS X
  • Linux (64-bit)

There are binary distributions for Mac OS X and many variants of Linux; you can also build it from source on almost any 64-bit Linux variant.

Building Flow

Flow is written in OCaml (OCaml 4.01.0 or higher is required) and (on Linux) requires libelf. You can install OCaml on Mac OS X and Linux by following the instructions at ocaml.org.

For example, on Ubuntu 14.04 and similar systems:

sudo apt-get install ocaml libelf-dev

Once you have these dependencies, building Flow just requires running

make

This produces a bin folder containing the flow binary.

Note: at this time, the OCaml dependency prevents us from adding Flow to npm. Try flow-bin if you need a npm binary wrapper.

Running the tests

To run the tests, first compile flow using make. Then run bash ./runtests.sh bin/flow

There is a make test target that compiles and runs tests.

To run a subset of the tests you can pass a second argument to the runtests.sh file.

For example: bash runtests.sh bin/flow class | grep -v 'SKIP'

Installing Flow

Flow is simple to install: all you need is the flow binary on your PATH and you're good to go.

Using Homebrew

Installing Flow with Homebrew package manager:

brew install flow

Using OPAM

You can also build and install flow via the OCaml OPAM package manager. Since Flow has some non-ocaml dependencies, you need to use the depext package like so:

opam install depext
opam depext --install flowtype

If you don't have a new enough version of OCaml to compile Flow, you can also use OPAM to bootstrap a modern version. Install OPAM via the binary packages for your operating system and run:

opam init --comp=4.01.0
opam install flowtype
eval `opam config env`
flow --help

Documentation

Check out http://flowtype.org for documentation and examples.

Join the Flow community

License

Flow is BSD-licensed. We also provide an additional patent grant.

Something went wrong with that request. Please try again.