All Projects â†’ azz â†’ ast-grep

azz / ast-grep

Licence: MIT license
🔍 Like grep, but more powerful than you can possibly imagine

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ast-grep

Phpgrep
Syntax-aware grep for PHP code.
Stars: ✭ 185 (+1221.43%)
Mutual labels:  ast, grep
cppcombinator
parser combinator and AST generator in c++17
Stars: ✭ 20 (+42.86%)
Mutual labels:  ast
toast
Plugin-driven CLI utility for code generation using Go source as IDL
Stars: ✭ 52 (+271.43%)
Mutual labels:  ast
abstract-syntax-tree
A library for working with abstract syntax trees.
Stars: ✭ 77 (+450%)
Mutual labels:  ast
psgrep
A simple little shell script to help with the "ps aux | grep" idiom.
Stars: ✭ 26 (+85.71%)
Mutual labels:  grep
tmuxjump.vim
A plugin to open file from file paths printed in sibling tmux pane
Stars: ✭ 50 (+257.14%)
Mutual labels:  grep
flutter ast
Flutter and Dart AST Analyzer/Parser
Stars: ✭ 87 (+521.43%)
Mutual labels:  ast
human-parser-generator
A straightforward recursive descent Parser Generator with a focus on "human" code generation and ease of use.
Stars: ✭ 27 (+92.86%)
Mutual labels:  ast
ngp
Ncurses code parsing tool
Stars: ✭ 52 (+271.43%)
Mutual labels:  grep
hgrep
Grep with human-friendly search results
Stars: ✭ 335 (+2292.86%)
Mutual labels:  grep
clickhouse-ast-parser
AST parser and visitor for ClickHouse SQL
Stars: ✭ 60 (+328.57%)
Mutual labels:  ast
ts-transform-react-constant-elements
A TypeScript AST Transformer that can speed up reconciliation and reduce garbage collection pressure by hoisting React elements to the highest possible scope.
Stars: ✭ 44 (+214.29%)
Mutual labels:  ast
pgsql-ast-parser
Yet another simple Postgres SQL parser
Stars: ✭ 152 (+985.71%)
Mutual labels:  ast
markright
A customizable markdown parser in Elixir: pure pattern matching.
Stars: ✭ 14 (+0%)
Mutual labels:  ast
ctxexp-parser
In the dynamic execution of JS language environment (wechat applet) to execute JS class calling function.
Stars: ✭ 17 (+21.43%)
Mutual labels:  ast
predeclared
Find definitions and declarations in Go source code that shadow predeclared identifiers
Stars: ✭ 26 (+85.71%)
Mutual labels:  ast
babel-plugin-detective
Babel plugin that scans the AST for require calls and import statements
Stars: ✭ 26 (+85.71%)
Mutual labels:  ast
py2many
Transpiler of Python to many other languages
Stars: ✭ 420 (+2900%)
Mutual labels:  ast
about-Vue
📔 Vue æșç çš„æŽąèźšć’Œć­Šäč 
Stars: ✭ 56 (+300%)
Mutual labels:  ast
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+128.57%)
Mutual labels:  ast

ast-grep

Travis Prettier npm semantic-release License

Like grep, but more powerful than you can possibly imagine.

Search your JavaScript files for patterns based on AST shape, rather than substrings or regular expressions.

Install

With yarn:

yarn global add ast-grep

With npm:

npm install --global ast-grep

Usage

$ ast-grep --help
Options:
  --anonymous, -a  Ignore all names in the AST                         [boolean]
  --file, -f       Load pattern from a file                             [string]
  --help           Show help                                           [boolean]
  --version        Show version number                                 [boolean]

Examples:
  ast-grep -a 'fn()' file.js           Find all no-arg function calls in
                                       'file.js'.
  ast-grep -f pattern.js '**/*.js'     Match the pattern in 'pattern.js' across
                                       all JS files.
  echo 'foo' | ast-grep 'pattern'      Match 'pattern' on standard input.

On standard in:

$ echo 'code();' | ast-grep 'code'
code();
$ ast-grep 'foo()' < file.js
foo();

On a set of files:

$ ast-grep 'yield* foo();' '**/*.js'

FAQ

Q. But @azz, grep stands for Global Regular Expression Print, this tool doesn't use Regular Expressions!

A. I know, but gastp doesn't sound great.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].