https://github.com/bunlong/react-reading-time-estimator
Medium's like reading time estimator for React.
https://github.com/bunlong/react-reading-time-estimator
hook hooks react react-reading-time-estimator reactjs reading-time
Last synced: about 1 year ago
JSON representation
Medium's like reading time estimator for React.
- Host: GitHub
- URL: https://github.com/bunlong/react-reading-time-estimator
- Owner: Bunlong
- License: mit
- Created: 2021-02-08T17:11:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-30T03:28:53.000Z (over 4 years ago)
- Last Synced: 2024-12-22T17:07:45.125Z (over 1 year ago)
- Topics: hook, hooks, react, react-reading-time-estimator, reactjs, reading-time
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-reading-time-estimator
Medium's like reading time estimator for React.
`react-reading-time-estimator` 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-reading-time-estimator is available on npm. It can be installed with the following command:
```
npm install react-reading-time-estimator --save
```
react-reading-time-estimator is available on yarn as well. It can be installed with the following command:
```
yarn add react-reading-time-estimator
```
## 💡 Usage
```js
import { useReadingTime } from "react-reading-time-estimator";
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-reading-time-estimator` 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-reading-time-estimator` 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 [](https://opensource.org/licenses/MIT)