What is reading-time?
The 'reading-time' npm package is designed to estimate the time it will take to read a given text. It is useful for applications that want to provide users with an idea of how long it will take to read an article, blog post, or any other text content.
What are reading-time's main functionalities?
Estimate Reading Time
This feature allows you to estimate the reading time of a given text. The 'readingTime' function takes a string as input and returns an object containing the estimated reading time in minutes, the number of words, and other relevant statistics.
const readingTime = require('reading-time');
const stats = readingTime('This is a sample text to estimate reading time.');
console.log(stats);
Custom Words Per Minute
This feature allows you to customize the words per minute (WPM) rate used to estimate the reading time. By default, the package uses 200 WPM, but you can change it to any value that suits your needs.
const readingTime = require('reading-time');
const options = { wordsPerMinute: 300 };
const stats = readingTime('This is a sample text to estimate reading time.', options);
console.log(stats);
Other packages similar to reading-time
reading-time-estimator
The 'reading-time-estimator' package provides similar functionality to 'reading-time' by estimating the reading time of a given text. It also allows customization of the words per minute rate. However, 'reading-time' is more widely used and has more frequent updates.
read-time-estimate
The 'read-time-estimate' package offers reading time estimation with additional features like handling HTML content and providing more detailed statistics. It is a good alternative to 'reading-time' if you need to process HTML content directly.
reading-time

Medium's like reading time estimation.
reading-time
helps you estimate how long an article will take to read.
It works perfectly with plain text, but also with markdown
or html
.
Note that it's focused on performance and simplicity, so the number of words it will extract from other formats than plain text can vary a little. But this is an estimation right?
Installation
npm install reading-time --production
Usage
Classic
const readingTime = require('reading-time');
const stats = readingTime(text);
Stream
const {readingTimeStream} = require('reading-time');
fs.createReadStream('foo')
.pipe(readingTimeStream)
.on('data', stats => {
});
API
readingTime(text, options?)
text
: the text to analyze- options (optional)
options.wordsPerMinute
: (optional) the words per minute an average reader can read (default: 200)options.wordBound
: (optional) a function that returns a boolean value depending on if a character is considered as a word bound (default: spaces, new lines and tabulations)
Help wanted!
This library has been optimized for alphabetical languages and CJK languages, but may not behave correctly for other languages that don't use spaces for work bounds. If you find the behavior of this library to deviate significantly from your expectation, issues or contributions are welcomed!
Other projects
- Fauda: configuration made simple.
- Badge Size: Displays the size of a given file in your repository.
- Commitizen Emoji: Commitizen adapter formatting commit messages using emojis.