Searching Open Source

January 06, 2017

GitHub has some pretty great tips for searching code. I primarily use this as a second-to-last resort when documentation isn’t completely clear and I’m about to reach out to pair with someone.

I tend to use the path and filename helpers the most.

For example, I’ve been teaching myself ember.js the past few weeks, and the other day I was struggling with creating records for nested models. I started searching for existing examples with queries like the following:

path:app/routes filename:new.js createRecord

The search results included several ember repos I could poke around in for learning purposes. Remember that you are usually not alone in what you are trying to do.