Skip to content

Script for transform javascript files to flowtype definition files

Notifications You must be signed in to change notification settings

arrizalamin/gen-flow-files

This branch is 7 commits behind ilyalesik/gen-flow-files:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 20, 2019
6a1be0c · Dec 20, 2019

History

87 Commits
Jan 18, 2019
Dec 19, 2019
Dec 20, 2019
Dec 19, 2019
Jan 16, 2019
Jan 16, 2019
Dec 18, 2019
Jan 18, 2019
Jan 18, 2019
May 8, 2019
Jan 19, 2019
Dec 19, 2019
Dec 20, 2019

Repository files navigation

gen-flow-files

npm version npm downloads

This is a script which finds .js files with @flow annotation, extract flow definitions and save to specific folder.

As example, <inputDir>/example.js

// @flow

extract function foo(arg1: number, arg2: string): string {
    // some code here
}

will be transformed to <outputDir>/example.js.flow:

// @flow

declare extract function foo(arg1: number, arg2: string): string;
Sponsored by Lessmess

Installation

Install it with yarn:

yarn add gen-flow-files

Or with npm:

npm i gen-flow-files --save

Usage

As part of build process

scripts": {
    ...
    "flow": "flow",
    "build:flow": "gen-flow-files src --out-dir dist",
    ...
  },

transfrom all .js files from src to .js.flow files and save them at dist.

As command

npx gen-flow-files <inputDir> --out-dir <outputDir>

transfrom all .js files from <inputDir> to .js.flow files and save them at <outputDir>.

About

Script for transform javascript files to flowtype definition files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%