1.0.0 • Published 5 years ago
@bowriverstudio/readingtime v1.0.0
Reading Time
This package calculates the estimated reading time based on Medium's algorithm. 200 words per min plus 12 seconds per image.
The output is a simple react component.
Installation
npm i @bowriverstudio/readingtimeSample Usage
import ReadingTime from "@bowriverstudio/readingtime";<ReadingTime theContent={post.content.rendered}></ReadingTime><ReadingTime
theContent={post.content.rendered}
wordsPerMinute="100"
></ReadingTime><ReadingTime
theContent={post.content.rendered}
imagesPerMinute="1"
></ReadingTime>export const StyledReadingTime = styled(ReadingTime)`
color: red;
`;<StyledReadingTime
theContent={post.content.rendered}
imagesPerMinute="1"
></StyledReadingTime>Demo
Simple demo using Frontity and this readingtime package.
https://reading-time-demo.bowriverstudio.vercel.app https://github.com/Bowriverstudio/reading-time-demo