Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
reading-time-estimator
Advanced tools
A medium's like reading time estimator with internationalization support
A medium's like reading time estimator with internationalization support.
Reading Time Estimator was created to provide an estimate of how long to read an article or blog as seen on medium.
With NPM
npm install reading-time-estimator
or Yarn
yarn add reading-time-estimator
The api is fairly simple. Here are the types definition for this module.
It is a simple function that takes the data as a required argument with the words per minute and locale as optional arguments.
Per default the locale is set to english en
.
Per default the word per minute is set to 300
.
At the moment there is only 12 supported locales: en
, fr
, es
, pt-br
, cn
, ja
, de
, tr
, ro
, bn
, sk
and cs
.
Try it live here
import { readingTime } from 'reading-time-estimator'
const text = 'some text to parse'
// default options
const result = readingTime(text, 10)
// output:
// {
// minutes: 4,
// words: 43,
// text: `4 min read`
// }
// with french locale
const result = readingTime(text, 10, 'fr')
// output:
// {
// minutes: 4,
// words: 43,
// text: `4 min de lecture`
// }
This package does not offer internationalization support which was a must for me.
Thanks goes to these wonderful people (emoji key):
Lucien Bénié 💻 📖 | Victor Sierra 💻 | ZhangC 💻 | Rich11 💻 📖 | Matheus Oliveira 💻 | Can Güven 💻 | Alexander Strutz 💻 |
凝结尾迹 💻 | Muhammad Faisal Amin 💻 | Oliver Groma 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
1.11.0 (2024-04-02)
FAQs
A medium's like reading time estimator with internationalization support
The npm package reading-time-estimator receives a total of 2,922 weekly downloads. As such, reading-time-estimator popularity was classified as popular.
We found that reading-time-estimator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.