{"library":"recma-parse","title":"recma JavaScript Parser Plugin","description":"recma-parse is a unified plugin for the recma ecosystem, designed to transform JavaScript source code into an Abstract Syntax Tree (AST). It leverages `esast-util-from-js` internally to parse JavaScript according to the ECMA-262 standard, producing ASTs in both esast and estree formats. As of its current stable version, 1.0.0, it is an ESM-only package, strictly requiring Node.js 16 or newer for execution. This package is part of the actively maintained `recma` monorepo, which provides a cohesive suite of tools for processing JavaScript ASTs, akin to how `remark` handles Markdown and `rehype` processes HTML. It differentiates itself by offering a robust, standards-compliant parsing step within the unified transformation pipeline, providing a foundational component for various JavaScript code transformations and analyses.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install recma-parse"],"cli":null},"imports":["import recmaParse from 'recma-parse'","import recmaParse from 'recma-parse'","import type { Options } from 'recma-parse'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import recmaBuildJsx from 'recma-build-jsx'\nimport recmaJsx from 'recma-jsx'\nimport recmaParse from 'recma-parse'\nimport recmaStringify from 'recma-stringify'\nimport { unified } from 'unified'\n\nasync function processJsx() {\n  const file = await unified()\n    .use(recmaParse)\n    .use(recmaJsx)\n    .use(recmaBuildJsx)\n    .use(recmaStringify)\n    .process('console.log(<em>Hi!</em>)')\n\n  console.log(String(file))\n}\n\nprocessJsx()\n","lang":"javascript","description":"This example demonstrates how to set up a unified pipeline using recma-parse to parse JavaScript, transform JSX elements using recma-jsx and recma-build-jsx, and then serialize the modified AST back into JavaScript code using recma-stringify. It processes a simple JSX expression and outputs the equivalent React.createElement call.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}