Crate ast_grep_napi

Source

Modules§

css
html
js
jsx
ts
tsx

Functions§

find_in_files
Discover and parse multiple files in Rust. lang specifies the language. config specifies the file path and matcher. callback will receive matching nodes found in a file.
kind
Get the kind number from its string name.
parse
Parse a string to an ast-grep instance
parse_async
Parse a string to an ast-grep instance asynchronously in threads. It utilize multiple CPU cores when concurrent processing sources. However, spawning excessive many threads may backfire. Please refer to libuv doc, nodejs’ underlying runtime for its default behavior and performance tuning tricks.
parse_files
pattern
Compile a string to ast-grep Pattern.
register_dynamic_language
Register a dynamic language to ast-grep. langs is a Map of language name to its CustomLanguage registration.