Flow Configuration File Parser
A utility package designed to parse `.flowconfig` files, enabling programmatic access to Flow type checker's configuration settings. The current and last published version of `flow-config-parser` is 0.3.0, released over seven years ago. While its repository `https://github.com/codemix/flow-runtime` remains active for other, related packages, `flow-config-parser` itself is no longer actively developed or maintained, making it effectively abandoned as a standalone package. It provides functions to inspect specific settings like `munge_underscores`, determine suppressed types, identify ignored files, and resolve module remapping directives within Flow's configuration.
Warnings
- breaking This package, `flow-config-parser`, is effectively abandoned. The last release was v0.3.0 over seven years ago. Users should be aware that it may not be compatible with newer Node.js versions, Flow versions, or modern JavaScript ecosystems (e.g., ESM modules).
- gotcha The GitHub repository linked (`https://github.com/codemix/flow-runtime`) and the provided 'Recent releases' (e.g., v0.19.0 for `babel-plugin-flow-runtime`) are for the broader `flow-runtime` project, not `flow-config-parser` itself. `flow-config-parser` has not been updated since v0.3.0.
Install
-
npm install flow-config-parser -
yarn add flow-config-parser -
pnpm add flow-config-parser
Imports
- parse
const parse = require('flow-config-parser')import parse from 'flow-config-parser'
Quickstart
import fs from 'node:fs';
import parse from 'flow-config-parser';
const flowConfigContent = fs.readFileSync('.flowconfig', 'utf8');
const config = parse(flowConfigContent);
console.log('Munge underscores:', config.get('munge_underscores')); // Example: true or false
console.log('Suppresses type $flowIgnore:', config.suppressesType('$flowIgnore')); // Example: true or false
console.log('Suppresses type Boolean:', config.suppressesType('Boolean')); // Example: true or false
console.log('Ignores file node_modules/react/react.js:', config.ignoresFile('node_modules/react/react.js')); // Example: true or false
console.log('Remaps module foo.scss:', config.remapModule('foo.scss')); // Example: 'object-shim.js' or null