Flow-bin is a wrapper package that provides the Flow static type checker binary for JavaScript projects. Developed primarily by Facebook/Meta, Flow offers static analysis capabilities similar to TypeScript, inferring types and catching errors before runtime. The package, currently at version `0.310.0`, bundles the corresponding Flow `0.310.0` binary, making it accessible via `npm` or `yarn` scripts and programmatically through Node.js's `child_process` module. While Flow itself is still actively developed and utilized internally at Meta, its public GitHub repository has been archived, meaning external contributions are no longer accepted, and community support is more limited. This positions `flow-bin` primarily as a maintenance package for delivering Meta's internal Flow updates to the public, rather than an actively evolving open-source project. Its release cadence is tied directly to Flow's internal release schedule. It serves as an alternative to TypeScript for adding static typing to JavaScript projects.
npm install flow-binVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically invoke the Flow binary using Node.js's `child_process.execFile` and parse its JSON output for type checking results.
Be aware that community support and external development for Flow are limited. For open-source projects, consider alternatives like TypeScript for more active community engagement and ecosystem tools.
Always review Flow's official release notes when upgrading `flow-bin` to understand potential breaking changes or new configuration requirements for the type checker itself.
Ensure you are using `flow-bin@v0.105.1` or newer if targeting Flow `v0.105.0` to guarantee the binaries are included.
Try running `npm rebuild flow-bin` or `npm install --force` to ensure the package and its binaries are correctly installed. Verify the version you are using is not `0.105.0`.
Create a `.flowconfig` file in your project's root directory. A minimal `.flowconfig` can be empty or include `[options]` and `[ignore]` sections. Refer to Flow documentation for configuration details.
For CommonJS environments, use `const flowPath = require('flow-bin');`. If you intend to use ESM, ensure your `package.json` contains `"type": "module"` and your Node.js version supports ESM, or use a bundler like Webpack or Rollup configured for ESM.No dependency data recorded yet.