Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flow-parser

Package Overview
Dependencies
Maintainers
6
Versions
338
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-parser

JavaScript parser written in OCaml. Produces ESTree AST

  • 0.256.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.3M
increased by9.65%
Maintainers
6
Weekly downloads
 
Created

What is flow-parser?

The flow-parser npm package is a JavaScript parser that parses JavaScript source code and produces an abstract syntax tree (AST) that is compliant with the Flow type checker syntax. It is primarily used for static type checking in JavaScript and can be used to analyze or transform JavaScript code.

What are flow-parser's main functionalities?

Parsing JavaScript code

This feature allows you to parse JavaScript code with Flow type annotations into an AST. The code sample demonstrates how to use the flow-parser to parse a simple line of code with a type annotation.

const flowParser = require('flow-parser');
const code = 'let x: number = 100;';
const ast = flowParser.parse(code);

Parsing with options

This feature allows you to provide options to the parser to enable or disable experimental features. The code sample shows how to parse code with options for decorators and export star syntax.

const flowParser = require('flow-parser');
const code = 'let x: number = 100;';
const options = { esproposal_decorators: true, esproposal_export_star_as: true };
const ast = flowParser.parse(code, options);

Other packages similar to flow-parser

FAQs

Package last updated on 06 Dec 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc