
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
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 4,209,600 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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.