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

do-link-element

v1.0.0

Published

Enhanced <a> links, transform your page into a SPA

Readme

do-link

A simple to use and non intrusive custom built-in element that enhances links in your static or server side rendered website to load remote pages asynchronously replacing the part of the document you specify with new content behaving like a single page application.

Similar attempts exist but this solution uses a native custom element loaded as a module, if the browser doesn't support modules nothing happens, your website works as usual :ok_hand: but if it does the anchor elements you specify in your page gain super powers :muscle: Some advantages of using this custom element loaded as a module over some libraries:

  • Progressive enhancement: Your page still works if the browser doesn't support the features required.
  • Size: The browser is doing most of the work, modern JavaScript and no transpilation keeps things small.
  • Simplicity: Import, use! It just does one thing and no glue JS is required for most cases.
  • Performance: Instantiating custom element is fast. Pages are pre-fetched and cached when link is about to be clicked*.
  • Dynamic creation of elements: No need for mutation observers or similar approach to enhance dynamically created links, when using custom elements existing and new tags get upgraded automatically.
  • No dependencies and good team player: keep using your favorite libraries and frameworks :wink:
  • Web standards :heart:
  • Open pages in a dialog(see below)

Usage

  1. Import
<head>
  <!-- other stuff -->
  <script type="module" src="https://olanod.github.io/do-link/link.js" async></script>
</head>
  1. Use
<a is="do-link" href="./a-page.html">Link to a page</a>
  1. Enjoy! :grin:

Content selection

Since the most common navigation pattern in a website is to keep your header, navigation, footer, etc. by default the <main> content of your page will be replaced with the <main> content of the linked page. If you want to change what element gets its content replaced and what element to take contents from:

<a is="do-link" href="./interesting-page.html" from="#my-container" into="aside">Show interesting info</a>

Dialog

If the into attribute is a dialog and the browser supports native dialog elements the dialog will be opened and the first form will have its method set to "dialog"

History

Visited links update the address bar using the history.pushState API.