Skip to content
master
Go to file
Code
This branch is 7973 commits behind facebook:master.

Latest commit

Yue Li Facebook Github Bot
Summary:
- Maintain the server state for file sync commands
- Parse the synchronized file contents separately
- Also update the [[ https://fb.quip.com/FjOoARaKJq8e | server state ]] document accordingly

Reviewed By: dabek

Differential Revision: D3580756

fbshipit-source-id: 1dc0f9e07fe85f8687c3ad600e1d557eb0bd8945
35e0cc1

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Apr 21, 2016

README.md

Flow Build Status Windows 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.

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

To ensure you get the latest version of Flow, update your Homebrew with:

brew update

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

Getting started

Getting started with flow is super easy.

  • Initialize Flow by running the following command in the root of your project
flow init
  • Add the following to the top of all the files you want to typecheck
/* @flow */
  • Run and see the magic happen
flow check

More thorough documentation and many examples can be found at http://flowtype.org.

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

On OSX, using the brew package manager:

brew install ocaml ocamlbuild libelf opam

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'

Join the Flow community

License

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

About

Adds static typing to JavaScript to improve developer productivity and code quality.

Resources

License

Packages

No packages published
You can’t perform that action at this time.