npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scully-plugin-time-to-read

v0.0.5

Published

The `scully-plugin-time-to-read` is a `routeProcess` plugin for [Scully](http://scully.io/) that processes a specific route and will add the 'readingTime' property to the `RouteData. This property reflects the time that people need to read the content.

Downloads

275

Readme

⌚ scully-plugin-time-to-read 📖

The scully-plugin-time-to-read is a routeProcess plugin for Scully that processes a specific route and will add the 'readingTime' property to the `RouteData. This property reflects the time that people need to read the content.

This plugin is designed (and tested) to work with the blog schematic and the contentFolder plugin.

📦 Installation

To install this plugin with npm run

$ npm install scully-plugin-time-to-read --save-dev

Usage

This package heavly rely on the scully blog schematics with markdown support.

  1. Open you scully configuration file (below is an example).
export const config: ScullyConfig = {
  projectRoot: './apps/blog/src',
  projectName: 'blog',
  outDir: './dist/static',
  routes: {
    '/articles/article/:id': {
      type: 'contentFolder',
      id: {
        folder: './articles',
      },
    },
  },
};
  1. Add the folowing configuration to your scully config before you scully config.
// scully.config.ts
setPluginConfig(timeToRead, {
  path: '<THE PATH TO YOUR ROUTES>'
} as timeToReadOptions);
  1. Change the path to your own path, this path property will be used to check the routes that are handled by scully. In our example we should put /articles/article/ in it. This way we know for sure that only our "blog" articles are being used by the plugin.
  2. Now the plugin should work, run scully --scanRoutes and check the scully-routes.json file. Here we should see a extra property like in the example below.
 {
        "route": "/blog/2020-12-21-blog",
        "title": "2020-12-21-blog",
        "description": "blog description",
        "published": true,
        "sourceFile": "2020-12-21-blog.md",
  --->  "readingTime": 1
    },
  1. You can now use the RouteData and get the readingTime property in your component. This can be done by using the ScullyRoutesService and pass the route with data to your component. Below a example of how you can use the readingTime property in your component.
      <mat-card-subtitle>
        Date: {{ route?.data?.date | date: 'dd-MM-yyyy' }} - {{ route?.data?.readingTime | number:'1.0-0'}} min read
      </mat-card-subtitle>