You're adding a new feature to your project. Because you don't want to reinvent the wheel, you discover a library you've never heard of that does exactly what you need.
Let's suppose for example that you want to send a request to an API go get some data in your NodeJS app. So you discover a library called
axios. You find out that to make a call to the API, you need to use the
So you read through the docs and see a couple of good examples. But what have other people use that function for? What are some real world examples of the
For this exact thing, there's a search engine you've probably seen before, but never used.
It's right there, at the top of your window, as soon as you go to Github!
Suppose you want to see some real world examples of people using the
get() function of
axios. All you have to do is go to Github, log in and use the search bar to search.
Alternatively, you can go to the new Github CodeSearch page.
Now start typing your piece of code you'd like to look examples of (quotes might help). In our case, our search query would be:
You'll see a bunch of results of other people's codes who have been kind enough to post their code for the public to see and learn from:
So if you are facing difficulties using a specific function you haven't used before, or the documentation for that function isn't really good (or non-existent) Github CodeSearch can be a lifesaving tool.
I know I've used this a ton of times and it has saved me hours of googling and getting nowhere.
Let me know what you think! Thanks for reading! 🔥