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

meriyah

Package Overview
Dependencies
Maintainers
1
Versions
918
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meriyah

Fast and lightweight, standard-compliant javascript parser written in ECMAScript

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
168K
increased by41.65%
Maintainers
1
Weekly downloads
 
Created

What is meriyah?

Meriyah is a fast and lightweight JavaScript parser that supports the latest ECMAScript standards. It is designed to be highly performant and can be used for various tasks such as syntax analysis, code transformation, and static code analysis.

What are meriyah's main functionalities?

Parsing JavaScript Code

This feature allows you to parse JavaScript code into an Abstract Syntax Tree (AST). The code sample demonstrates how to parse a simple JavaScript statement and log the resulting AST.

const meriyah = require('meriyah');
const ast = meriyah.parseScript('const x = 10;');
console.log(ast);

Parsing with Options

Meriyah supports various parsing options such as module parsing and JSX syntax. The code sample shows how to parse a script with these options enabled.

const meriyah = require('meriyah');
const ast = meriyah.parseScript('const x = 10;', { module: true, jsx: true });
console.log(ast);

Error Handling

Meriyah provides error handling capabilities to catch and handle syntax errors during parsing. The code sample demonstrates how to catch a parsing error and log the error message.

const meriyah = require('meriyah');
try {
  const ast = meriyah.parseScript('const x = ;');
} catch (e) {
  console.error('Parsing error:', e.message);
}

Other packages similar to meriyah

Keywords

FAQs

Package last updated on 19 Apr 2019

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