GithubHelp home page GithubHelp logo

lunaruan / flow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/flow

1.0 0.0 0.0 57.71 MB

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

Home Page: https://flow.org/

License: MIT License

Shell 2.28% JavaScript 26.53% OCaml 68.00% Standard ML 0.05% C 1.54% Makefile 0.24% HTML 0.38% CSS 0.49% Ruby 0.26% PowerShell 0.01% Liquid 0.14% Python 0.01% C++ 0.06% Dockerfile 0.01%

flow's Introduction

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

flow's People

Contributors

a7c avatar alexchow avatar andrewjkennedy avatar avikchaudhuri avatar ballardrog avatar bhosmer avatar dabek avatar dlreeves avatar dsainati1 avatar dsereni avatar ericlippert avatar gabelevi avatar gkz avatar goodmind avatar int3 avatar jbrown215 avatar jeffmo avatar jwatzman avatar ljw1004 avatar mroch avatar msullivan avatar mvitousek avatar nmote avatar oulgen avatar pakoito avatar panagosg7 avatar pzp1997 avatar samwgoldman avatar vjeux avatar zertosh avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.