Skip to content
Proyek

Tentang

Menambahkan pengetikan statis ke JavaScript untuk meningkatkan produktivitas pengembang dan kualitas kode.

Produktivitas dan otomatisasi

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
-3
dalam 7 hari
-1
dalam 15 hari
+4
dalam 1 bulan
+14

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Flow

CircleCI Follow @flowtype MIT License GitHub contributors GitHub top language Join Discord Chat

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

Contents

Requirements

Flow works with:

  • macOS (arm64)
  • Linux (x86_64 and arm64)
  • Windows (x86_64, 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 the usage docs.

Using Flow's parser from JavaScript

Flow's 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 Rust. GitHub CI builds Flow from the rust_port workspace with Rust 1.100.0 and RUSTC_BOOTSTRAP=1.

  1. Install system dependencies:

    • Install Rust via rustup.

    • Install the Rust toolchain:

      rustup toolchain install 1.100.0
      
  2. Build the Rust workspace:

    cd rust_port
    RUSTC_BOOTSTRAP=1 cargo +1.100.0 build
    
  3. Run the Rust tests:

    RUSTC_BOOTSTRAP=1 cargo +1.100.0 test
    
  4. Build an optimized flow binary:

    RUSTC_BOOTSTRAP=1 cargo +1.100.0 build --release --bin flow_cli
    
  5. Build flow.js (optional):

    The flow.js build also uses the Rust port. Install Emscripten, Node, Yarn, and the Rust toolchain with the wasm32-unknown-emscripten target and rust-src component first. GitHub CI uses Emscripten 3.1.44 and Rust 1.100.0 for this build.

    rustup toolchain install 1.100.0 --target wasm32-unknown-emscripten --component rust-src
    RUSTUP_TOOLCHAIN=1.100.0 make js FLOW_JS_IMPL=rust-wasm
    

    This produces bin/flow.js.

    To build a faster, larger local development version instead, run:

    RUSTUP_TOOLCHAIN=1.100.0 make js FLOW_JS_IMPL=rust-wasm FLOW_DOT_JS_WASM_PROFILE=dev
    

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

Running the tests

See tests/README.md for detailed testing documentation.

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).

Jelajahi proyek terkait

Memuat…