11pm: Dive into Literature with Free Books in Your Terminal
It's getting late, let's take a break and get some reading done with some classic literature right in your terminal window.
What does this article replace?
This article replaces traditional ebook readers or websites by providing a means to read books directly in the terminal.
How long will it take to set up?
Approximately 10 minutes, including downloading and setting up the Freeread
package and installing the necessary dependencies.
3 out of 5 stars
Difficulty Rating:
Reading books in the terminal falls into the moderate difficulty level of 3 out of 5. It requires familiarity with terminal-based text editors or reading tools, as well as navigating and accessing book files in the terminal environment. It's an unconventional way to enjoy your reading experience, adding a tech-savvy twist to your routine.
Step 1: Clone the Repository and Install Dependencies
First, you'll need to clone the freeread
repository and install all the required dependencies. Open a terminal and run:
git clone https://github.com/invisibleloop/freeread.git
cd freeread
npm install
Ensure you have the ebook-convert
command-line tool installed on your system (using Homebrew) as it is essential for the conversion of epub files to txt.
Step 2: Select and Read a Book
In the package, there are two scripts defined for reading a book:
npm run read
: This command runs the script with a light mode reading. The terminal background will be white, and the text will be black.npm run read:dark
: This command runs the script with dark mode reading. The terminal background will be black, and the text will be white.
Run one of these commands based on your preference. It will then prompt you to select a book from the list. Use the arrow keys to navigate and select a book, then press Enter.
While reading a book, you can navigate through the pages as follows:
Space bar
: Press the Space bar to go to the next page.
Arrow keys
: Use the Up and Down arrow keys to scroll line by line.
Page Up/Down
: You can also use Page Up and Page Down keys for faster navigation.
q
: To quit less and return to the terminal, simply press q.
Currently, the application provides only two books from Project Gutenberg:
- "Alice's Adventures in Wonderland" by Lewis Carroll
- "The Time Machine" by H. G. Wells
These two books are hardcoded into the script. If you want to add more books, you would need to add more entries to the books array in the script, each with a title and a direct download link for an epub version of the book from Project Gutenberg.
Note
The freeread
package is designed to work with Node.js version 18 or later. Ensure you have an appropriate version installed on your system before running the application.
Also, be aware that the reading experience and the overall terminal look and feel might vary depending on the terminal emulator you're using and its specific configurations.
As you dive into classic literature from the command line, remember: it's not only about what you read but also about the unique way you're accessing it. Turn off the lights, sink into your chair, and dive into a good book.