Book finder is a command line application written in Node.js. It allows you to search the Google Books API and save books to a local JSON reading list.
Before running the program, you must set your API_KEY
in the terminal.
export API_KEY=<YOUR API KEY>
and then npm install
to install the axios and chalk dependencies.
If you already have a Google Books API key, you can skip the next section.
Google API keys are easy to get! You can sign in to the Google cloud platform with your Google account here. From there, create a new project, and then go to the API and Services page. Search for Google Books, click on it, then click ENABLE. After you have your API key, save it to your terminal as shown above.
More information can be found here.
To start the program, cd
into the programs main directory and type node book_finder.js
into the terminal.
After that, you can type in one of the following 5 commands:
help
: Brings up the list of commandssearch ____
: Searches the Google Books API for books matching your search term. Ex:search puppies
will return 5 books about puppies.save ___
: Saves a book to your reading list. Ex:save 2
will save the second book from your previous search.view
: Shows you your saved Reading List.quit
: Exits the program.
Tests are written using Mocha/Chai. To run them, type npm test
in the terminal.
I used the following modules in this project: