https://github.com/ilyalesik/gen-flow-files
Script for transform javascript files to flowtype definition files
https://github.com/ilyalesik/gen-flow-files
flow flowtype
Last synced: 3 months ago
JSON representation
Script for transform javascript files to flowtype definition files
- Host: GitHub
- URL: https://github.com/ilyalesik/gen-flow-files
- Owner: ilyalesik
- Created: 2019-01-16T12:00:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-27T17:02:43.000Z (over 3 years ago)
- Last Synced: 2025-03-17T23:44:42.313Z (3 months ago)
- Topics: flow, flowtype
- Language: JavaScript
- Homepage:
- Size: 269 KB
- Stars: 28
- Watchers: 4
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-flow - gen-flow-files - Script for transform JavaScript files to flow definition files. (Tools)
README
# gen-flow-files
[](https://www.npmjs.com/package/gen-flow-files)
[](https://www.npmjs.com/package/gen-flow-files)This is a script which finds `.js` files with @flow annotation, extract flow definitions and save to specific folder.
As example, `/example.js`
```javascript
// @flowextract function foo(arg1: number, arg2: string): string {
// some code here
}
```
will be transformed to `/example.js.flow`:
```javascript
// @flowdeclare extract function foo(arg1: number, arg2: string): string;
```## 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```json
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 --out-dir
```
transfrom all *.js* files from `` to *.js.flow* files and save them at ``.