GithubHelp home page GithubHelp logo

grolicek / reading-time-estimator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lbenie/reading-time-estimator

0.0 0.0 0.0 5.65 MB

A medium's like reading time estimator with internationalization support

Home Page: https://lbenie.xyz

JavaScript 19.80% TypeScript 80.20%

reading-time-estimator's Introduction

reading-time-estimator

Test Lint Semantic Release Commitizen friendly semantic-release npm npm npm bundle size (minified)

All Contributors

forthebadge forthebadge forthebadge

A medium's like reading time estimator with internationalization support.

Documentation

Reading Time Estimator was created to provide an estimate of how long to read an article or blog as seen on medium.

Installation

With NPM

  npm install reading-time-estimator

or Yarn

  yarn add reading-time-estimator

API

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.

Usage

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`
// }

Why Not ...?

reading-time

This package does not offer internationalization support which was a must for me.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Lucien Bénié
Lucien Bénié

💻 📖
Victor Sierra
Victor Sierra

💻
ZhangC
ZhangC

💻
Rich11
Rich11

💻 📖
Matheus Oliveira
Matheus Oliveira

💻
Can Güven
Can Güven

💻
Alexander Strutz
Alexander Strutz

💻
凝结尾迹
凝结尾迹

💻
Muhammad Faisal Amin
Muhammad Faisal Amin

💻
Oliver Groma
Oliver Groma

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

reading-time-estimator's People

Contributors

renovate[bot] avatar renovate-bot avatar lbenie avatar semantic-release-bot avatar dependabot[bot] avatar allcontributors[bot] avatar matheusinit avatar can-guven avatar faisalamin9696 avatar grolicek avatar richardmen11 avatar zchazc avatar zs1m avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.