@meriyah-utils/walker
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Meriyah AST Walker

Based on estree-walker by Rich Harris. On top of this library this one adds additional types of walkers for various use-cases.

It also aims to provide more reliable typings

Usage

import * as meriyah from "meriyah";
import { walk } from "@meriyah-utils/walker";

const ast = meriyah.parseModule(code, {
  module: true,
  webcompat: true,
  directives: true,
  next: true,
  raw: true,
  jsx: true,
});

walk(ast, {
  enter(node, parent, prop, index) {
    // some code happens
  },
  leave(node, parent, prop, index) {
    // some code happens
  },
});

Readme

Keywords

none

Package Sidebar

Install

npm i @meriyah-utils/walker

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

18.9 kB

Total Files

15

Last publish

Collaborators

  • jasperdm