Bunlong / react-hook-reading-time

Medium's like reading time estimation for React.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-hook-reading-time

Medium's like reading time estimation for React.

react-hook-reading-time helps you estimate how long an article will take to read. It works perfectly with plain text.

🎁 Features

  • Compatible with both JavaScript and TypeScript

πŸ”§ Install

react-hook-reading-time is available on npm. It can be installed with the following command:

npm install react-hook-reading-time --save

react-hook-reading-time is available on yarn as well. It can be installed with the following command:

yarn add react-hook-reading-time

πŸ’‘ Usage

import { useReadingTime } from "react-hook-reading-time";

const {
  text, // 1 min read
  minutes, // 1
  words, // 168
  time, // 0.5309090909090909
} = useReadingTime(text);

πŸ“š Hook

useReadingTime(text: string)

  • text – the text to be estimated.

πŸ’– Wrap Up

If you think any of the react-hook-reading-time can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

🌟 Contribution

We'd love to have your helping hand on contributions to react-hook-reading-time by forking and sending a pull request!

Your contributions are heartily β™‘ welcome, recognized and appreciated. (βœΏβ— β€Ώβ— )

How to contribute:

  • Open pull request with improvements
  • Discuss ideas in issues
  • Spread the word
  • Reach out with any feedback

βš–οΈ License

The MIT License License: MIT

About

Medium's like reading time estimation for React.

License:MIT License


Languages

Language:TypeScript 68.6%Language:JavaScript 31.4%