Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document usage of JS parsers #77

Open
RayLuxembourg opened this issue Aug 9, 2021 · 1 comment
Open

Document usage of JS parsers #77

RayLuxembourg opened this issue Aug 9, 2021 · 1 comment

Comments

@RayLuxembourg
Copy link

RayLuxembourg commented Aug 9, 2021

please provide an example so I could PR to add into readme.

discovered

func pareJSFile(path string) {
	jsStr, err := ioutil.ReadFile(path)
	if err != nil {
		fmt.Println(err)
		return
	}
	jsAst,err:= js.Parse(parse.NewInputBytes(jsStr))
	if err != nil {
		log.Fatal(err)
	}
	v:= Visitor{}
	js.Walk(v,jsAst)
}
@RayLuxembourg RayLuxembourg changed the title how to traverse that js AST ? how to traverse the js AST ? Aug 9, 2021
@tdewolff tdewolff changed the title how to traverse the js AST ? Document usage of JS parsers Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@RayLuxembourg and others