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

readability-cli

v2.4.5

Published

Firefox Reader Mode in your terminal - get useful text from a web page using Mozilla's Readability library

Downloads

172

Readme

readability-cli

Firefox Reader View in your terminal!

readability-cli takes any HTML page and strips out unnecessary bloat by using Mozilla's Readability library. As a result, you get a web page which contains only the core content and nothing more. The resulting HTML is suitable for terminal browsers, text readers, and other uses.

Here is a before-and-after comparison, using an article from The Guardian as a test subject.

Standard view in W3M

An article from The Guardian in W3M

So much useless stuff that the main article does not even fit on the screen!

readability-cli + W3M

An article from The Guardian in W3M using readability-cli

Ah, much better.

Installation

readability-cli can run via either Node.js or its newer and safer Rust counterpart Deno.

Node.js

Install the program and its man page:

npm install -g readability-cli

(Note to package maintainers: it might be a good idea to provide a symlink, so the man page can be accessed either as readability-cli(1) or as readable(1))

Deno

Deno support is still in development, running the script directly with deno run <URL> is not supported.

However, you can clone this Git repository and easily run the readable.ts script.

git clone https://gitlab.com/gardenappl/readability-cli/
cd readability-cli
./readable.ts

You can use deno run with the locally-downloaded script to fine-tune permissions, for example:

curl https://example.com | deno run --no-check readable.ts

By default Deno does not allow reading & writing files or accessing the network, meaning you have to rely on piping data in and out.

Read more about Deno permissions in their manual.

(Package maintainers might consider adding a readable-sandbox executable which will run readable with restrictions)

Arch Linux

Arch Linux users may use the "official" AUR packages:

Usage

readable [SOURCE] [options]

readable [options] -- [SOURCE]

where SOURCE is a file, an http(s) URL, or '-' for standard input

See readability-cli(1) for more information, and usage examples.

Localization

See locales.

Why Node.js? It's so slow!

I know that it's slow, but JavaScript is the most sensible option for this, since Mozilla's Readabilty library is written in JavaScript. There have been ports of the Readability algorithm to other languages, but Mozilla's version is the only one that's actively maintained as of 2020.