Last Updated: February 25, 2016
·
983
· victorquinn

Make ack node aware

I love ack and its very not opinionated domain ;)

But, trying to use it on a Node project without some tweaks was a nightmare. This is because, among other issues, by default, it crawled the entire node_modules directory looking for your search query.

Adding a ~/.ackrc file (or modifying your existing one) and adding the following will fix this problem:

# Make ack Node friendly :)
--ignore-dir=node_modules
--type-set=coffee=.coffee
--type-set=jade=.jade
--type-set=json=.json

These bits tell ack to ignore the node_modules directory, and to ensure it checks in some filetypes it would otherwise ignore.