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-links

v0.11.0

Published

Links in Comark: external links with the rel and target you choose and a warning before a new tab, and a # link beside each heading. For HTML, Vue, React, and Svelte.

Readme

comark-links

npm version npm downloads license docs

Links in Comark: a # link beside each heading, and external links with the target and rel you choose and a warning before one opens a new tab. For HTML, Vue, React, and Svelte.

pnpm add comark comark-links
import { createHtmlRenderer } from "@comark/html";
import { anchors, components, external } from "comark-links/html";

const render = createHtmlRenderer({
  plugins: [anchors(), external({ target: "_blank", hosts: ["example.com"] })],
  components,
});

Each plugin works alone, so register only the ones you want.

Heading links

anchors() gives each h2, h3, and h4 a # link to itself, after the heading and outside it, as Starlight renders them:

<div class="cl-heading">
  <h2 id="setup">Setup</h2>
  <a class="cl-anchor" href="#setup"><span aria-hidden="true">#</span><span class="cl-sr">Section titled "Setup"</span></a>
</div>

The heading stays where it is in the document's tree, so a table of contents built from it still works; the components draw the link. A heading without an id gets none. Its options change the levels, what screen readers hear, and what the link shows:

anchors({ levels: [2, 3], label: (text) => `Link to ${text}`, icon: "¶" });

External links

external() writes target and rel on links to other sites while parsing, so every renderer outputs them. It never replaces a {target} or {rel} you write on a link.

| Option | Default | | | --- | --- | --- | | target | false | Where external links open, such as "_blank" | | rel | [] | Words added to rel, such as ["nofollow"]; noopener joins whenever the target is _blank | | hosts | [] | Your own hosts, whose links count as internal | | test | http(s) links not on hosts | Which links are external, from their href | | icon | true | Draws ↗ after a link that opens a new tab | | label | "(opens in a new tab)" | What screen readers hear after it, as WCAG's G201 asks |

target is off by default, so readers choose where a link opens.

Renderers

| Renderer | Import | | --- | --- | | @comark/html | comark-links/html: the styles are inlined | | @comark/vue | comark-links/vue | | @comark/react | comark-links/react | | @comark/svelte | comark-links/svelte |

Each entry exports both parse plugins and the renderer's components, which replace how h1 to h6 render. The Vue, React, and Svelte components add the styles when they mount; import comark-links/style.css with your styles so a server-rendered page doesn't shift. The styles sit in a comark CSS layer, so any plain rule of your own wins.