Socket
Book a DemoInstallSign in
Socket

@untemps/read-per-minute

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@untemps/read-per-minute

Class to parse a string and return an estimated reading time based on a lang rate

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
1
Created
Source

@untemps/read-per-minute

Class to parse a long text and return an estimated reading time based on a lang rate.

npm GitHub Workflow Status Codecov

Installation

yarn add @untemps/read-per-minute

Usage

Import the functions:

import { parse, isLangExist, rates } from '@untemps/read-per-minute'

Call parse with a string and a lang (see Override the value for a one-time parsing for an alternative usage):

parse('Long text', 'en')

The parse function returns an object with the following properties:

PropertyDescription
timeThe estimated reading time in minutes
wordsThe number of words in the text
rateThe rate value used to calculate the reading time

Default Rates

Default rate values come from "How many words do we read per minute? A review and meta-analysis of reading rate" by Marc Brysbaert - Department of Experimental Psychology Ghent University

LangRate
default200
ar181
zh260
nl228
en236
fi195
fr214
de260
he224
it285
ko226
es278
sv218

If the lang is not listed or is undefined, the default value will be used instead.

Custom Rates

Override all the values

You can specify an entire custom rates object as the third parameter of parse or isLangExist:

const customRates = {
	default: 220,
	ar: 191,
	zh: 255,
	nl: 234,
	en: 244,
}
parse('Long text', 'en', customRates)
isLangExist('en', customRates)

NOTE: Set a default property in the object if you want the parsing to fallback to a specific value. Otherwise, the static value will be used (rates.default).

Override the value for a one-time parsing

Simply pass the desired custom reading rate in words per minute instead of a language code:

// For very fast readers: 425 words per minute.
parse('Long text', 425)

NOTE: The custom reading rate must be greater than zero or the default value will be used.

Keywords

estimated reading time

FAQs

Package last updated on 30 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts