@untemps/read-per-minute

2.0.1 • Public • Published

@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 ReadPerMinute:

import { ReadPerMinute } from '@untemps/read-per-minute'

Create an instance of ReadPerMinute:

const rpm = new ReadPerMinute()

Call the parse method with a string and a lang:

rpm.parse('Long text', 'en')

Get the parsed values:

const estimatedReadingTime = rpm.time
const numberOfWords = rpm.words
const langRate = rpm.rate

Rates

Reading rates by lang 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

Lang Rate
default 200
ar 181
zh 260
nl 228
en 236
fi 195
fr 214
de 260
he 224
it 285
ko 226
es 278
sv 218

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

Package Sidebar

Install

npm i @untemps/read-per-minute

Weekly Downloads

5

Version

2.0.1

License

MIT

Unpacked Size

7.11 kB

Total Files

5

Last publish

Collaborators

  • untemps