npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-book-shell

v0.1.13

Published

Search books on Google Books

Downloads

19

Readme

Google Book Shell

Search Google Books from command line window.

Video of "How to Install & Use Google-Book-Shell"

How to Install & Use Google-Book-Shell

How to Install

npm install -g google-book-shell

If you have already installed it before (Thank you 😇), update it as shown below.

npm update -g google-book-shell

Link to Google-Book-Shell NPM page.


How to Run 🏃‍

Type gbs

dance2die@LELOUCH c:\misc\sources
> gbs
google book search$

Usage

Type help for the list of commands

google book search$ help

  Commands:

    help [command...]  Provides help for a given command.
    exit               Exits application.
    search <book>      search for a book in Google Books
    open <number>      open # in searched book list
    view <number>      view detailed description of the book
    print              print searched books

Commands

search

  • USAGE: search <book name> (book name is required).
  • ALIAS: s
  • DESCRIPTION: Searches for the book on Google Books.
  • If the name has a space, use a double/single quote around the name.
  • EXAMPLE
google book search$ search "Grokking Algorithms"
01: Grokking Algorithms
02: Grokking Deep Learning
03: Algorithms For Dummies
04: Algorithms Unlocked
05: Data Structures and Algorithms in Python
06: Essential Algorithms
07: The Algorithm Design Manual
08: The CS Detective
09: Algorithmic Puzzles
10: Python Algorithms

open

  • USAGE: open [options] <number> (number is required).
  • ALIAS: o
  • DESCRIPTION: Opens the searched book by the search result order in a web browser.
  • NOTE: Works only after search is run.
  • OPTIONS:
Options:
    --help                        output usage information
    -a, --amazon                  open Amazon link
    -s, --strip-amazon-affiliate  strip affiliate query parameter
  • --amazon (or -a for short): Opens Amazon Web Link with affiliate info

    • Amazon's Product API requires a developer to sign up as an affiliate so this was unavoidable.
    • So I added the following option (-s) to strip out affiliate info if you choose to do so
    • This flag calls an Azure Function, which needs to wake up after some inactivity (Takes about 10~30 seconds). It will work faster after the first call. Example
  • --strip-amazon-affiliate (or -s for short): Strip out affiliate info (Please support me by not using this flag 👼)

  • e.g.)

    • open 1
    • open -a 1 (or open --amazon 1)
    • open -a -s 1 (or open --amazon --strip-amazon-affiliate 1)
    • YouTube walk-through

    How to Install & Use Google-Book-Shell

view

  • USAGE: view [number] (number is optional).

  • ALIAS: v

  • DESCRIPTION: Displays the description of the searched book in console by search result order.

  • When [number] argument is missing, it will let user choose a book to view detail for

  • NOTE: Works only after search is run.

  • EXAMPLE with [number] argument. Example with [number] argument.

  • EXAMPLE withOUT [number] argument. Example withOUT [number] argument.

print

  • USAGE: print
  • ALIAS: p
  • DESCRIPTION: Reprints searched book result
  • Note: Displays nothing when no search was performed previously.
  • EXAMPLE
google book search$ print                    
01: Grokking Algorithms                      
02: Grokking Deep Learning                   
03: Algorithms For Dummies                   
04: Algorithms Unlocked                      
05: Data Structures and Algorithms in Python 
06: Essential Algorithms                     
07: The Algorithm Design Manual              
08: The CS Detective                         
09: Algorithmic Puzzles                      
10: Python Algorithms                        

Demo using Aliases only

You can search, view details, and open browser much faster with aliases. alias demo


How to‍ 🏃‍ from the Source

  1. Clone the source: git clone https://github.com/dance2die/google-book-shell.git
  2. Install NPM packages/dependencies npm install or yarn
  3. Run it using npm or yarn
  • yarn start

    --or--

  • npm run start


TODO

  • Separate each command into different files.
  • Use a plugin archiecture to dynamically load commands.
  • ? Compare prices from Google Books/Amazon/Barnes & Noble?