A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/facebook/flow below:

facebook/flow: Adds static typing to JavaScript to improve developer productivity and code quality.

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

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.

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:

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

    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:

    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.

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'

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4