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 🙏

© 2026 – Pkg Stats / Ryan Hefner

comark-seo

v0.2.0

Published

Comark plugin that analyses Markdown for SEO

Readme

comark-seo

Comark plugin that analyses Markdown for SEO: headings, links, images, word count and reading time.

Install

pnpm add comark-seo

Requires comark >= 0.4 as a peer dependency.

Usage

import { parseMarkdown } from 'comark'
import seo from 'comark-seo'

const tree = await parseMarkdown(markdown, {
  plugins: [seo({ language: 'fra', readingSpeed: 150 })],
})

console.log(tree.meta.seo)

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | enabled | boolean | true | Set to false to skip the analysis. | | language | 'fra' \| 'eng' | — | Stop words ignored in repeatedWords. None are ignored if unset. | | readingSpeed | number | 200 | Words per minute used for readingTime. |

Result

tree.meta.seo holds the analysis:

{
  content:  { words, readingTime, repeatedWords },
  headings: { count, h1Count, hierarchyValid },
  links:    { count, internal, external, special: { anchor, emails, phone }, invalid },
  images:   { count, missingAlt },
  issues:   [ /* see below */ ]
}

Everything is JSON-serialisable, so tree.meta can be sent in an SSR payload or cached as-is.

content

words counts the text of the document. Fenced blocks and inline code are skipped, so snippets and identifiers do not inflate the count.

readingTime is in minutes, rounded to the nearest minute and never below 1.

repeatedWords lists the words appearing more than once, sorted by descending count, ties broken alphabetically:

[
  { word: 'est', count: 12 },
  { word: 'web', count: 9 },
  { word: 'construire', count: 7 },
]

Set language to drop stop words such as le, de or the from that list.

links

Every link is classified into exactly one bucket:

| Bucket | Matches | | --- | --- | | external | Absolute http(s) URL, or protocol-relative //host | | internal | Any relative path: /guide, ./page.md, ../up.md, page.md | | special.anchor | Starts with # | | special.emails | mailto: | | special.phone | tel: | | invalid | Missing href, or an unsupported scheme such as ftp: or javascript: |

headings

hierarchyValid is false as soon as one level is skipped (for example h2 straight to h4). Every break is still reported individually in issues.

Issues

Each entry in issues is a discriminated union on reason:

| reason | Extra fields | Raised when | | --- | --- | --- | | missing-heading-one | — | The document has no h1 | | multiple-h1 | count | The document has more than one h1 | | heading-hierarchy | from, to | A heading level is skipped | | heading-too-long | from, text | A heading exceeds 60 characters | | invalid-heading | — | A heading tag outside h1h6 | | missing-alt | src | An image has no alt attribute | | missing-dimensions | src, missing | An image lacks width, height or both | | invalid-link | href | A link uses an unsupported scheme | | missing-url | text | A link has no href |

Heading text is flattened before being measured, so ## A **bold** title is counted in full.

License

MIT © Corentin NELHOMME