@meriyah-utils/walker
v1.0.2
Published
Based on `estree-walker` by Rich Harris. On top of this library this one adds additional types of walkers for various use-cases.
Downloads
4
Readme
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
},
});