New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-reading-time-2

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-reading-time-2

📰 Gatsby plugin for reading-time integration

0.1.1
latest
npm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Artwork by Katerina Limpitsouni

gatsby-plugin-reading-time-2

A Gatsby plugin to estimate your markdown files reading time.

This plugin is sort of a fork from gatsby-remark-reading-time updated and with added configuration.

✨ Features

  • Medium like reading time estimation (based on reading-time).
  • Compatible with Mdx and MarkdownRemark.
  • Configurable.

⚙️ Installing

For Yarn users:

yarn add gatsby-plugin-reading-time-2

For Npm users:

npm install gatsby-plugin-reading-time-2

🚀 Usage

With Mdx

Add gatsby-plugin-reading-time-2 as a plugin in gatsby-config.js:

module.exports ={
  plugins: [
    // ...
    `gatsby-plugin-reading-time-2`,
    // ...
  ],
}

With MarkdownRemark

Add gatsby-plugin-reading-time-2 as a MarkdownRemark plugin in gatsby-config.js:

module.exports ={
  plugins: [
    // ...
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          // ...
          `gatsby-plugin-reading-time-2`,
          //... 
        ]
      }
    },
    // ...
  ],
}

🔧 Configuration

This plugin accepts 2 options following reading-time options:

  • options.wordsPerMinute: the words per minute an average reader can read (default: 200).
  • options.wordBound: a function that returns a boolean value depending on if a character is considered as a word bound (default: spaces, new lines and tabs).

Resolve the plugin as follows to use them:

{
  resolve: `gatsby-plugin-reading-time-2`,
  options: {
    wordsPerMinute: 200,
    wordBound: function(c) { return ' \n\r\t'.includes(c) },
  }
}

🤝 Contributing

Any contribution to the project is welome.
Run into a problem? Open an issue.
Want to add some feature? PRs are welcome!

📝 Licence

Copyright © 2021 Sacha Bouillez.
This project is under MIT license.

Keywords

gatsby

FAQs

Package last updated on 18 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts