Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Grasp – JavaScript structural search, replace, and refactor (graspjs.com)
78 points by nailer on Dec 16, 2017 | hide | past | favorite | 13 comments


SSR (structural search and replace) is one of the greatest but overlooked features of IntelliJ. It helps with refactorings a lot


I was going to make the same comment. It's amazing how often I see enthusiastic reports on new tools whose equivalent has been just a keyboard shortcut away in IntelliJ for years.

Maybe I should add a c2.com wiki page for 'SmugIntelliJWeenie'



I played around with jscodeshift and ASTExplorer a few weekends ago. I found it to be fairly opaque. All I was hoping to do was remove a wrapping function and replace it with its child/children. The documentation for jscodeshift is fairly rudimentary. I had high hopes of creating examples and submitting them as PRs... but alas, a weekend is only so long. Perhaps this weekend will have me giving it another shot with this tool.


I've been able to use this for some basic stuff like renames, but still trying to work on a way to convert old style string concats:

    'foo'+bar+'baz'
to current JS template literals:

    `foo${bar}baz`
If you do it first, let me know! Otherwise I'll throw mine on npm.


I remember running across this when I was researching jscodeshift, though that seems to have a steeper learning curve.


Exciting tool. I look forward to working with it.


This is honestly great.


It's funny to see how many tools a non-lisp programmer needs...


Lisp programmer here. This seems genuinely useful, in all languages.

Can you describe how you'd do their examples (like "find the word 'remote', but only when used as an identifier") in Lisp?


You can pry Clojure from my cold, lifeless hands, but this term is popular for a reason: http://wiki.c2.com/?SmugLispWeenie

If you really want to convince someone your way is better, you should probably be less condescending (and if not, you’re just gloating).


npm star grasp


haters




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: