
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
flow-parser
Advanced tools
This package contains the Flow parser in its JavaScript package form.
See flow.org. The code for the Flow parser lives on GitHub.
The Flow Parser is a JavaScript parser for Flow syntax. It produces an AST that conforms to the ESTree spec. This npm package contains the Flow Rust parser compiled to WASM with JavaScript bindings.
You can use the Flow parser in node:
const {parse} = require('flow-parser');
parse('1+1', {});
The second argument to parse is the options object. Common options:
flow ('detect' or 'all', default 'detect') - parse Flow syntax only with an @flow pragma, or always parse Flow syntaxsourceType ('module', 'script', or 'unambiguous') - parse the file as a module, script, or infer it from the contentstokens (boolean, default false) - include a list of all parsed tokens in a top-level tokens propertybabel (boolean, default false) - return a Babel-shaped ASTenableEnums (boolean, default true) - enable parsing of enumsenableExperimentalFlowMatchSyntax (boolean, default true) - enable parsing of match expressions and match statementsenableExperimentalComponentSyntax (boolean, default true) - enable parsing of component syntaxassertOperator (boolean, default false) - enable parsing of the assert operatorenableExperimentalDecorators (boolean, default true) - enable parsing of decoratorsAcorn is a small, fast, JavaScript-based JavaScript parser that produces an AST. It is used by various tools within the JavaScript ecosystem. Acorn is highly extensible through plugins and can handle modern JavaScript syntax. While flow-parser is specific to Flow type annotations, Acorn is more general-purpose and does not have built-in support for Flow types.
typescript-eslint-parser is a parser that allows ESLint to lint TypeScript code. It converts TypeScript into an ESTree-compatible form so it can be used in the existing ESLint ecosystem. Unlike flow-parser, which is specific to Flow, typescript-eslint-parser is designed to work with TypeScript and can be used to enforce TypeScript-specific linting rules.
FAQs
JavaScript parser written in OCaml. Produces ESTree AST
The npm package flow-parser receives a total of 5,399,111 weekly downloads. As such, flow-parser popularity was classified as popular.
We found that flow-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.