Flow

0 min read


Hello Stackers, today we talking about JS type. Flow is a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making you code faster, smarter, more confidently, and to a bigger scale.

Flow checks your code for errors through static type annotations. These types allow you to tell Flow how you want your code to work, and Flow will make sure it does work that way.

FLOW IS A STATIC TYPE CHECKER FOR JAVASCRIPT.

Quick Start

yarn add --dev @babel/core @babel/cli @babel/preset-flow

in .babelrc

{
  "presets": ["@babel/preset-flow"]
}

running

yarn run babel src/ -d lib/

add to package.json

{
  "name": "my-project",
  "main": "lib/index.js",
  "scripts": {
    "build": "babel src/ -d lib/",
    "prepublish": "yarn run build"
  }
}

yarn add --dev flow-bin
yarn run flow

Okay that’s All folks, for the full documentation you can refer on here. see you later..

Bima Sena
  1. vyn says:

    Nice article sir!

Leave a Reply

Your email address will not be published. Required fields are marked *