astGrep(pattern, callback)
console.log($$$A)
; by default relaxed
strictness algorithm is used, meaning that comments and non-significant syntax constructs (like single and double quotes for JavaScript) will be ignored.ast-grep
engine.NapiConfig
object, so you can copy rules from ast-grep playground and paste them here.AstGrepAPI
. In this case request is sent to ast-grep
CLI and you can use all its features, like fix
. But there is no programmatic access to the results, it is one-way operation. It has similar syntax to NapiConfig
, but with additional id
field.