{"id":22433700,"url":"https://github.com/gavinning/flow-node-compiler","last_synced_at":"2025-03-27T07:45:57.728Z","repository":{"id":57238775,"uuid":"140386764","full_name":"gavinning/flow-node-compiler","owner":"gavinning","description":"use flow in nodejs","archived":false,"fork":false,"pushed_at":"2018-11-16T04:02:31.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:46:35.704Z","etag":null,"topics":["flow","flow-compiler","flow-in-nodejs","flow-node","flow-node-compiler","flow-nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavinning.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-10T06:24:00.000Z","updated_at":"2022-04-08T22:36:18.000Z","dependencies_parsed_at":"2022-08-26T15:11:58.048Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/flow-node-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fflow-node-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fflow-node-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fflow-node-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fflow-node-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/flow-node-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806390,"owners_count":20675296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flow","flow-compiler","flow-in-nodejs","flow-node","flow-node-compiler","flow-nodejs"],"created_at":"2024-12-05T22:15:41.644Z","updated_at":"2025-03-27T07:45:57.710Z","avatar_url":"https://github.com/gavinning.png","language":"JavaScript","readme":"Flow-node-compiler\n---\n在nodejs中使用flow | use flow in nodejs  \n\n主要是方便在nodejs中使用flow，开发这个包之前找了一下，  \n没发现有类似功能的，本人又非常想在nodejs中使用flow，索性就封装了一个    \n\n特点：入侵小，产出源码友好，几乎就是未加flow type标记之前的代码风格，  \n当有一天不需要flow了，直接使用产出代码继续开发就好了\n\n主要功能点：  \n* 监听``src``目录下的源码文件    \n* js文件更改时：  \n    * 启用flow检查 [不通过则报错，通过则继续]\n    * 同步删除flow type标记\n    * 格式化代码\n    * 产出到``dist``目录\n* 对于非js文件，直接产出到``dist``目录  \n\n``src``和``dist``是配置项，可以自由指定源码目录和产出目录\n\n### Install\n```sh\nnpm i flow-node-compiler --save-dev\n```\n\n### Usage\nStep 1\n```sh\nflow init  # 工作目录下执行 如果需要自行配置相关选项\n```\nStep 2\n```json\n{\n    \"script\": {\n        \"dev\": \"npm run flow \u0026 nodemon dist/app.js\",\n        \"flow\": \"flow-node-compiler --src=src --dist=lib\"\n    }\n}\n```\nStep 3\n```sh\nnpm run dev  # nodemon 根据自身项目需要决定是否配置\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fflow-node-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Fflow-node-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fflow-node-compiler/lists"}