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

liverender

v0.2.1

Published

Reload the page body at a specified rate via a script attribute

Readme

liverender npm install liverender test badge gzip size dependencies

Reload the page content at a set interval by diffing and patching the live DOM — no full page refresh, only the parts that changed are updated.

<script data-refresh="5s" src="https://cdn.jsdelivr.net/npm/liverender"></script>

This library is designed for very simple, very static websites — think dashboards, status pages, or server-rendered HTML that updates periodically. It will not work correctly for pages that rely on JavaScript-driven UI, client-side routing, or dynamic <script> injection.

Usage

Add the script tag to your HTML with a data-refresh attribute specifying how often to reload:

<!-- Reload every 5 seconds -->
<script data-refresh="5s" src="https://cdn.jsdelivr.net/npm/liverender"></script>

<!-- Reload every 30 seconds -->
<script data-refresh="30s" src="https://cdn.jsdelivr.net/npm/liverender"></script>

<!-- Reload every 2 minutes -->
<script data-refresh="2m" src="https://cdn.jsdelivr.net/npm/liverender"></script>

Supported time units

| Unit | Example | Interval | |------|---------|----------| | Seconds | data-refresh="10s" | 10 s | | Minutes | data-refresh="5m" | 5 min | | Hours | data-refresh="1h" | 1 h | | Days | data-refresh="1d" | 24 h | | Weeks | data-refresh="1w" | 7 days | | Milliseconds | data-refresh="500ms" | 500 ms |

How it works

On each interval, liverender fetches the current page URL, parses the response as HTML, and walks both the live document and the fetched document from <html> down — diffing and patching only the nodes that actually changed. Text changes, attribute updates, added or removed elements are all handled; unchanged nodes are left alone.

Because nodes are patched in place rather than replaced wholesale, the browser does not re-run <script> tags that appear in the fetched HTML. This is intentional for the liverender script itself (you don't want it to restart its own timer), but it also means any other <script> tags in the page will not execute on subsequent fetches. Similarly, event listeners attached via JavaScript will be lost when the element they're bound to is replaced.

This approach works well when:

  • The page is server-rendered HTML that updates over time (dashboards, feeds, status pages)
  • Content changes are in markup and text, not driven by client-side JS

It will not work correctly when:

  • The page uses a JS framework (React, Vue, etc.)
  • New <script> tags need to run on each update
  • Event listeners or component state matter between refreshes

Install

npm install liverender

Or load directly from a CDN (no build step needed):

<script data-refresh="5s" src="https://cdn.jsdelivr.net/npm/liverender"></script>

License

MIT