Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

facebook/flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCIFollow @flowtypeMIT LicenseGitHub contributorsGitHub top languageJoin Discord Chat

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

Contents

Requirements

Flow works with:

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

There arebinary distributions for each of these platforms and you can also build it from source on any of them as well.

Using Flow

Check out theinstallation instructions, and thenthe 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, namedflow-parser.Most end users of Flowwill not need to use this parser directly, but JavaScript packages which make use of parsingFlow-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: seeopam docs

    • Windows:cygwin and a number of dependencies likemake,gcc andg++ are required.

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

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

  2. Validate theopam version is2.x.x:

    opam --version

    The following instructions expect2.x.x. Should your package manager have installed a1.x.x version, please refer to theopam docs to install a newer version manually.

  3. Initializeopam:

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

    # from within this git checkoutmake deps

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

  5. Build theflow binary:

    eval$(opam env)make

    This produces thebin/flow binary.

  6. Buildflow.js (optional):

    opam install -y js_of_ocaml.5.7.2make js

    This producesbin/flow.js.

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

Running the tests

To run the tests, first compile flow usingmake. Then runbash ./runtests.sh bin/flow

There is amake test target that compiles and runs tests.

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

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

Join the Flow community

License

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

About

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

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp