0.0.1 • Published 3 years ago

gatsby-read-time-estimate v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

gatsby-remark-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

VariableTypeDescription
humanizedDurationstringHumanized Duration for the input string
durationnumberActual Duration of the input string (in minutes)
totalWordsnumberNumber of words in the input string
wordTimenumberRead Time of the words in the input string (in minutes)
totalImagesnumberNumber of images in input string
imageTimenumberRead Time of the images in the input string (in minutes)
otherLanguageTimeCharactersnumberChinese / Japanese / Korean language characters count
otherLanguageTimenumberRead 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