Skip to content

pritishvaidya/gatsby-read-time-estimate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-read-time-estimate

Description

Gatsby plugin to add an accurate measurement of read time using any content

Contents

Installation

$ npm i read-time-estimate --save
// gatsby-config.js
...
  plugins: [
    ...
    `gatsby-read-time-estimate`,
  ]

Parsing algorithm

It recognizes the content node from the files and adds read-time-estimate props to it

Properties

Variable Type Description
humanizedDuration string Humanized Duration for the input string
duration number Actual Duration of the input string (in minutes)
totalWords number Number of words in the input string
wordTime number Read Time of the words in the input string (in minutes)
totalImages number Number of images in input string
imageTime number Read Time of the images in the input string (in minutes)
otherLanguageTimeCharacters number Chinese / Japanese / Korean language characters count
otherLanguageTime number Read Time of the Chinese / Japanese / Korean in the input string (in minutes)

How to query

A sample GraphQL query to get Read Time Estimate node:

{
  allMarkdownRemark {
      nodes {
        fields {
          readTimeEstimate {
            duration
            humanizedDuration
            imageTime
            otherLanguageTime
            otherLanguageTimeCharacters
            totalImages
            totalWords
            wordTime
          }
        }
      }
    }
}

Contribution

Questions

Feel free to contact me or create an issue

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published