Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

remark-reading-time

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-reading-time

Adds estimated reading time to your markdown files

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
153K
0.77%
Maintainers
1
Weekly downloads
 
Created
Source

remark-reading-time

Adds estimated reading time to your markdown files using reading-time.

Usage

import readingTime from "remark-reading-time";

remark()
  .use(readingTime)
  .process(markdown, function (err, file) {
    console.log("Reading time is " + file.data.readingTime.text);
  });

By default, it will add the data to readingTime in your data. This can be changed:

import readingTime from "remark-reading-time";

remark()
  .use(readingTime, { attribute: "myKeyName" })
  .process(markdown, function (err, file) {
    console.log("Reading time is " + file.data.myKeyName.text);
  });

MDX

You can also export the data to MDX files:

import { compile } from "@mdx-js/mdx";
import remarkReadingTime from "remark-reading-time";
import readingMdxTime from "remark-reading-time/mdx";

const code = await compile(file, {
  compileOptions: {
    remarkPlugins: [
      remarkReadingTime,
      readingMdxTime, // register the mdx after the remarkReadingTime plugin
    ],
  },
});

FAQs

Package last updated on 09 Mar 2026

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