Skip to content
Adds static typing to JavaScript to improve developer productivity and code quality.
OCaml JavaScript Shell C CSS HTML Other
Branch: master
Clone or download
mroch and facebook-github-bot v0.114.1
Reviewed By: samwgoldman, panagosg7

Differential Revision: D19247218

fbshipit-source-id: 39f909da41e1035fb93141afee8ff2db5d7284a0
Latest commit fbdf007 Dec 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci [PR] Allow lwt.4.4.0 on windows Dec 28, 2019
.github [PR] docs: label user reported bugs with "needs triage" label Mar 19, 2019
examples remove flux-chat example Feb 7, 2018
js Enforce copyright headers for more JS files Dec 10, 2019
lib [PR] feat: add rudimentary Array.flat Dec 19, 2019
newtests [PR] feat: add rudimentary Array.flat Dec 19, 2019
packages v0.114.1 Dec 28, 2019
prelude Enforce copyright headers for lib/ Dec 10, 2019
resources Add copyright header to other files Dec 10, 2019
scripts Add copyright header to other files Dec 10, 2019
src v0.114.1 Dec 28, 2019
tests > and } in JSX child text is a parse error Dec 23, 2019
website v0.114.1 Dec 28, 2019
.gitattributes [PR] Mark "tests/malformed_code/text.js" as binary Apr 27, 2017
.gitignore [PR] Dune support Jul 16, 2019
.merlin consolidate .merlin files Jun 28, 2019
.ocamlformat Upgrade ocamlformat to v0.12.0 Nov 14, 2019
CODE_OF_CONDUCT.md Adopt Contributor Covenant Aug 30, 2019
CONTRIBUTING.md Update CONTRIBUTING.md Jan 29, 2019
Changelog.md v0.114.1 Dec 28, 2019
LICENSE
Makefile Delete unnecessary NO_SQLITE3 and NO_HHVM c flags from ocamlbuild and… Dec 12, 2019
README.md [PR] [DOCS] Updated readme urls to use https instead of http Oct 28, 2019
_tags Add ppx_deriving_show to polarity module Nov 20, 2019
appveyor.yml [PR] Bump required ocaml version to 4.07.1 Jul 26, 2019
dune Delete unnecessary NO_SQLITE3 and NO_HHVM c flags from ocamlbuild and… Dec 12, 2019
dune-project [PR] Dune support Jul 16, 2019
dune-workspace [PR] Dune support Jul 16, 2019
opam v0.114.1 Dec 28, 2019
package.json bump sshpk dependency Jul 19, 2019
runtests.sh Add copyright header to .sh files Dec 10, 2019
tool Move tool into packages/ folder Jan 31, 2018
yarn.lock [lsp] fix test URIs on windows Oct 18, 2019

README.md

Flow Build Status Windows Build Status Join the chat at https://discordapp.com/invite/8ezwRUK

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

For a background on the project, please read this overview.

Contents

Requirements

Flow works with:

  • macOS
  • Linux (64-bit)
  • Windows (64-bit, 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 how to get started.

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 4.07.1 is required).

  1. Install opam:
  1. Initialize opam:
opam init
  1. Install OCaml and Flow's dependencies:
# from within this git checkout
opam switch create . --deps-only -y
  1. Build the flow binary:
eval $(opam env)
make

This produces the bin/flow binary.

  1. Build flow.js (optional):
opam install -y js_of_ocaml.3.4.0
make js

This produces bin/flow.js.

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

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 MIT-licensed (LICENSE). The website and documentation are licensed under the Creative Commons Attribution 4.0 license (website/LICENSE-DOCUMENTATION).

You can’t perform that action at this time.