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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@prasadaabhishek/readtime

v1.0.0

Published

Tiny zero-dependency reading-time estimator

Readme

readtime

readtime is a tiny, zero-dependency Node.js reading-time estimator for plain text, Markdown, and HTML. It provides seconds, rounded minutes, human labels, detailed statistics, streaming, and a practical CLI while keeping its core below 5 KB.

Install

npm install github:prasad-a-abhishek/readtime

Quick start

const readtime = require('readtime');
const text = '# Hello\n\nA useful article.';
console.log(readtime.seconds(text));
console.log(readtime.minutes(text));
console.log(readtime.human(text));

CommonJS only — import syntax requires you to add an ESM wrapper yourself.

API

| API | Result | |---|---| | seconds(text, options?) | Integer seconds, rounded up | | minutes(text, options?) | Minutes rounded to decimals, with threshold | | human(text, options?) | Human-readable label | | stats(text, options?) | Words, characters, sentences, paragraphs, time, WPM and format | | html(text, options?) | Stats after HTML stripping | | markdown(text, options?) | Stats after Markdown stripping | | new ReadtimeStream(options?) | Pass-through stream; sets readingTimeSeconds on completion |

Options

| Option | Default | Description | |---|---:|---| | wordsPerMinute | 200 | Positive reading speed | | decimals | 1 | Minute precision, 0–10 | | minMinutes | 0.5 | Minimum non-empty rounded-minute result | | format | short | short, long, tiny, or json | | countChars | nonWhitespace | Set to all to include whitespace |

The HTML parser is a compact state machine: it removes tags/comments and script/style contents, handles quoted attributes and decodes common/numeric entities. Markdown handling removes fenced code and frontmatter, preserves link/image labels, and normalizes common headings, emphasis, lists, quotes, rules, inline code, and embedded HTML.

CLI

readtime [options] <file|->
--stdin                 read stdin
--wpm <number>          reading speed
--format <short|long|tiny|json>
--html                  HTML mode
--markdown              Markdown mode
--help                  usage
--version               version

Examples:

readtime article.txt
echo 'hello world' | readtime --stdin
readtime --wpm 250 --format json article.md
readtime --format short --html page.html

Why another reading-time library?

Because this common calculation should not require a dependency tree. readtime uses only Node's standard library, offers HTML, Markdown, statistics, streaming and CLI support, and remains easy to audit.

Benchmark / feature comparison

Measured package characteristics rather than claiming universal runtime numbers (performance varies by machine and input):

| | readtime | reading-time | |---|---:|---:| | Runtime dependencies | 0 | 0 | | Core (count.js + format.js) | < 5 KB minified | package-dependent | | HTML + Markdown stripping | Yes | Basic word counting | | Detailed stats / CLI / stream | Yes | Different API/features |

For reproducible throughput comparisons, run both against the same corpus and Node release; this implementation performs a small number of linear passes.

License

MIT