Hacker News new | ask | show | jobs
by NikhilVerma 1856 days ago
I made a small utility to help me search for JS code better. It's called @nikhilverma/ast-grep. It works really well for my use case but I hope to polish it more and release it more widely.

npx @nikhilverma/ast-grep '{ meta: { title: "___" }}' src/

This will search for any object with a key meta which is also an object and has a property called title which is any string. It uses AST for grepping so you don't need to worry about placement, whitespaces etc.