flow

向JavaScript添加静态类型以提高开发人员的工作效率和代码质量。(Adds static typing to JavaScript to improve developer productivity and code quality.)

  • 所有者: facebook/flow
  • 平台: Linux, Mac, Windows
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者facebook/flow
主編程語言OCaml
編程語言Shell (語言數: 13)
平台Linux, Mac, Windows
許可證MIT License
所有者活动
創建於2014-10-28 17:17:45
推送於2025-06-30 14:19:09
最后一次提交
發布數414
最新版本名稱v0.274.2 (發布於 )
第一版名稱v0.1.0 (發布於 2014-11-18 10:34:57)
用户参与
星數22.2k
關注者數383
派生數1.9k
提交數19.4k
已啟用問題?
問題數6699
打開的問題數660
拉請求數160
打開的拉請求數17
關閉的拉請求數2293
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?