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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@opral/markdown-wc

v0.5.0

Published

--- imports: - ./dist/walking-dinosaur.js - https://cdn.jsdelivr.net/npm/@opral/markdown-wc-doc-elements/dist/doc-video.js

Readme


imports:

  • ./dist/walking-dinosaur.js
  • https://cdn.jsdelivr.net/npm/@opral/markdown-wc-doc-elements/dist/doc-video.js

Opral Markdown WC

Enables writing documentation with web components in markdown.

---
imports: 
  - https://cdn.jsdelivr.net/npm/@opral/markdown-wc/dist/walking-dinosaur.js
---

# Opral Markdown WC 

Enables writing documentation with web components in markdown.

<walking-dinosaur></walking-dinosaur>
<doc-video src="https://youtu.be/IMjJ1jvKsZU"></doc-video>

Why

  • Enables writing documentation with components in markdown
  • Interoperable with existing markdown parsers
  • Doesn't depend on a framework like React MDX or Svelte MDsveX
  • Doesn't introduce custom syntax like Markdoc

Comparison

| Feature | Markdown | @opral/markdown-wc | React MDX | Svelte MDsveX | Markdoc | |--------------------------------|----------|--------------------|-----------|---------------|---------| | Components in markdown | ❌ | ✅ | ✅ | ✅ | ✅ | | Framework agnostic | ✅ | ✅ | ❌ | ❌ | ✅ | | Portable | ✅ | ✅ | ❌ | ❌ | ❌ | | No custom syntax | ✅ | ✅ | ❌ | ❌ | ❌ |

Usage in browser

The <markdown-wc-embed> element can be used to embed markdown-wc in a webpage.

  <script type="module" src="https://cdn.jsdelivr.net/npm/@opral/markdown-wc/dist/markdown-wc-embed.js"></script>
  <body>
    <markdown-wc-embed src="https://my-markdown-url.com/markdown.md"></markdown-wc-embed>
  </body>

Usage in another markdown file

The <markdown-wc-embed> element can be used to embed markdown-wc in markdown-wc.

---
imports:
  - https://cdn.jsdelivr.net/npm/@opral/markdown-wc/dist/markdown-wc-embed.js
---

# Hello World

This is a markdown file that embeds another markdown file 🤯

<markdown-wc-embed src="https://cdn.jsdelivr.net/gh/opral/monorepo@latest/packages/markdown-wc/README.md"></markdown-wc-embed>

Usage as libary

Enables SSR and more control over the rendering process.

import { parse } from '@opral/markdown-wc';

const markdown = `

# Hello World

// This is a web component
<doc-card>
  <h1>Card Title</h1>
  <p>Card content</p>
</doc-card>
`;

// Parse markdown
const parsed = parse(markdown);

// Register web components
for (const url of parsed.frontmatter.imports ?? []) {
  // optionally sanitize the imported imported here
  // by, for example, only trusting a specific domain
  await import(url)
}

// render HTML
render(parsed.html);

Limitations

  • sanitzation of markdown as well as custom elements is not implemented atm
  • SSR is DIY atm (use the parse function and SSR the markdown with lit for example)

FAQ

Why not use React MDX or Svelte MDsveX?

React MDX and Svelte MDsveX are great tools but they introduce a dependency on a specific framework which is a no-go for portability.

Why not use a <script> tag to import the web components?

Markdown parsers don't remove the <script> tag from the output. This means that the script tag would be rendered in the final HTML. To increase interoperability, frontmatter is used to define imports.