@bowriverstudio/readingtime

React Component similar to Medium's reading time estimation.

Usage no npm install needed!

<script type="module">
  import bowriverstudioReadingtime from 'https://cdn.skypack.dev/@bowriverstudio/readingtime';
</script>

README

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/readingtime

Sample 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

Code

https://github.com/Bowriverstudio/readingtime