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

@plugdash/heartpost

v0.2.0

Published

Like button for EmDash posts - readers heart your content

Downloads

229

Readme

@plugdash/heartpost

Readers want to acknowledge a post without writing a comment. Writes a KV-backed heart count per content item on click, deduplicated by fingerprint. Ships HeartButton.astro - a drop-in heart button with a bottom-to-top fill animation. No WordPress equivalent - only on EmDash.

Install

pnpm add @plugdash/heartpost

Register

// astro.config.mjs
import { defineConfig } from "astro/config";
import emdash from "emdash";
import { heartpostPlugin } from "@plugdash/heartpost";

export default defineConfig({
  integrations: [
    emdash({
      plugins: [heartpostPlugin()],
      // or sandboxed: [heartpostPlugin()]
    }),
  ],
});

Configuration

Admin dashboard

After installing, open the EmDash admin and go to Plugins - Heart Post - Settings. All options are available there. Changes take effect on the next publish - no code changes required.

Config options

Configuration is stored in the plugin's KV store and can be changed via the admin UI or programmatically. Defaults are seeded on install.

| Option | Type | Default | Description | | ----------- | ---------- | ---------- | -------------------------------------------- | | collections | string[] | all | Limit processing to specific collection slugs | | label | string | "hearts" | Label for the heart count (admin display) |

Companion component

Exported as @plugdash/heartpost/HeartButton.astro.

---
import HeartButton from "@plugdash/heartpost/HeartButton.astro";
const post = await emdash.content.get("posts", Astro.params.id);
---

<HeartButton post={post} />

Props

| Prop | Type | Default | Description | | ------- | ---------------------------------- | ---------- | ----------------------------- | | post | Record<string, unknown> | (required) | Content item - the component reads post.id or post.data.id (checks both) | | variant | "circle" \| "pill" \| "ghost" | "circle" | Visual style | | size | "sm" \| "md" \| "lg" | "md" | Component size | | theme | "auto" \| "dark" \| "light" | "auto" | Color scheme | | class | string | "" | Additional CSS class |

Variants

  • circle - heart icon in a rounded button, count hidden (default)
  • pill - heart icon + count in a rounded pill
  • ghost - heart icon + count, no border or background

CSS custom properties

| Property | Default | Description | | --------------------------------- | ---------------------------------- | -------------------- | | --plugdash-heart-color | var(--plugdash-accent, #6366f1) | Heart fill color | | --plugdash-heart-fill-duration | 200ms | Fill animation speed | | --plugdash-engage-size | 2rem | Button size | | --plugdash-engage-radius | 9999px | Border radius | | --plugdash-engage-border | rgb(from currentColor r g b / 0.15) | Border color | | --plugdash-engage-bg | rgb(from currentColor r g b / 0.04) | Background color | | --plugdash-engage-bg-hover | rgb(from currentColor r g b / 0.08) | Hover background |

How it works

  • Initialises a heart count (0) in KV on first publish via content:afterSave
  • Re-publish does not reset existing counts
  • POST route increments count and stores a fingerprint hash (sha256 of IP + User-Agent, truncated to 16 chars)
  • GET route returns current count and whether the current visitor has hearted
  • Fingerprint dedup prevents double-counting, not rigorous identity verification
  • No cookies, no accounts, no PII stored

What it does not do

  • Does not process drafts, archived, or scheduled content
  • Does not provide atomic increment (uses KV get+set - occasional missed hearts under extreme concurrency are acceptable)
  • Does not store any personally identifiable information
  • Does not require authentication to heart a post
  • Does not support unhearting (hearts are permanent)
  • Does not provide an admin page for viewing heart counts (planned)