how2 – A simple way to browse stack overflow from the terminal
I am very much interested to write CLI related applications as I am spending most of the time with terminal (in other hand, we can say it’s a black screen) for my day to day activity.
Stack Overflow is the largest, most trusted online community for developers to learn, share their programming knowledge, and build their careers. It’s world’s largest developer community and allows users to ask and answer questions.
It’s open alternative to earlier question and answer sites such as Experts-Exchange.
We had written about the same topic in our previous article, the tool name is called SoCLI. Today also we are going to discuss about the same topic called how2.
As we discussed many times, everything is possible in Linux. We would get many options as well (i mean, we get multiple applications for the same purpose, each application has it’s own unique features).
How to install how2
how2 is built on nodejs and we can be install via npm package manager. If you didn’t install npm & nodeJS package already, run the following command to install it.
$ sudo apt install npm
For Archlinux users, use Pacman Command to install npm package.
$ sudo pacman -S npm
For Fedora users, use DNF Command to install npm package.
$ sudo dnf install npm
For CentOS/RHEL users, use YUM Command to install npm package.
$ sudo yum install npm
For openSUSE users, use Zypper Command to install npm package.
$ sudo zypper install npm
Finally run the following npm command to install how2 tool.
$ sudo npm install -g how-2
How to use how2
I got an error in the above result, which is marked in red color box. I did small google search and found the solution, just add the below value into
transport.js file to fix it.
If you don’t know the
transport.js file location. Use the below find command to figure it out.
$ sudo find / -name transport.js /usr/local/lib/node_modules/how2/node_modules/devnull/transports/transport.js
If you had found the file in then you have to make the below change to fix it.
$ sudo vi /usr/local/lib/node_modules/how2/node_modules/devnull/transports/transport.js From: var EventEmitter = process.EventEmitter; To: var EventEmitter = require('events')
If you would like to search about particular language related questions, use
-l option with how2.
$ how2 -l shell "script to get uptime in multiple servers"
This tool has done its job as expected, it doesn’t have advanced options such as interactive search, topic based search, post new question, etc,.
I would suggest you to use SoCLI utility, if you are looking more professional tool. If you are looking for basic Stack Overflow search then you can stick with this how2 tool.