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

@86d-app/announcements

v0.0.40

Published

Site-wide announcement bars, promotional banners, and notification banners for 86d commerce platform

Readme

@86d-app/announcements

📚 Documentation: 86d.app/docs/modules/announcements

Site-wide announcement bars, promotional banners, and popup notices for the 86d commerce platform. Schedule announcements, target specific audiences, and track engagement with built-in analytics.

Installation

bun add @86d-app/announcements

Usage

import announcements from "@86d-app/announcements";

const module = announcements({
  maxActiveAnnouncements: 5,
});

Store component

import { AnnouncementBar } from "@86d-app/announcements/components";

// In your layout — shows active bar-type announcements
<AnnouncementBar audience="all" />

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | maxActiveAnnouncements | number | 5 | Maximum announcements shown simultaneously |

Store Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /announcements/active | Get currently visible announcements | | POST | /announcements/:id/impression | Record an impression | | POST | /announcements/:id/click | Record a CTA click | | POST | /announcements/:id/dismiss | Record a dismissal |

Query parameters for /announcements/active

| Parameter | Type | Description | |-----------|------|-------------| | audience | "all" \| "authenticated" \| "guest" | Filter by visitor type |

Admin Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /admin/announcements | List all announcements | | POST | /admin/announcements/create | Create a new announcement | | GET | /admin/announcements/:id | Get announcement details | | PUT | /admin/announcements/:id/update | Update an announcement | | DELETE | /admin/announcements/:id/delete | Delete an announcement | | POST | /admin/announcements/reorder | Reorder announcements by priority | | GET | /admin/announcements/stats | Get engagement statistics |

Controller API

createAnnouncement(params)

Create a new announcement with title, content, and optional display settings.

getAnnouncement(id)

Get a single announcement by ID. Returns null if not found.

listAnnouncements(opts?)

List announcements with optional filters: activeOnly, type, position, limit, offset.

getActiveAnnouncements(opts?)

Get announcements currently visible to visitors. Respects isActive, schedule window (startsAt/endsAt), and audience targeting.

updateAnnouncement(id, data)

Update announcement fields. Preserves analytics counters (impressions, clicks, dismissals).

deleteAnnouncement(id)

Delete an announcement permanently.

reorderAnnouncements(ids)

Set display priority based on array order. First ID gets priority 0, second gets 1, etc.

recordImpression(id) / recordClick(id) / recordDismissal(id)

Increment engagement counters. Silent no-op for non-existent IDs (safe for fire-and-forget from frontend).

getStats()

Returns aggregate statistics:

{
  totalAnnouncements: number;
  activeAnnouncements: number;    // active + within schedule window
  scheduledAnnouncements: number; // active but startsAt is in the future
  expiredAnnouncements: number;   // endsAt is in the past
  totalImpressions: number;
  totalClicks: number;
  totalDismissals: number;
  clickRate: number;              // clicks / impressions (0-1)
  dismissRate: number;            // dismissals / impressions (0-1)
}

Types

Announcement

interface Announcement {
  id: string;
  title: string;
  content: string;
  type: "bar" | "banner" | "popup";
  position: "top" | "bottom";
  linkUrl?: string;
  linkText?: string;
  backgroundColor?: string;
  textColor?: string;
  iconName?: string;
  priority: number;
  isActive: boolean;
  isDismissible: boolean;
  startsAt?: Date;
  endsAt?: Date;
  targetAudience: "all" | "authenticated" | "guest";
  impressions: number;
  clicks: number;
  dismissals: number;
  metadata?: Record<string, unknown>;
  createdAt: Date;
  updatedAt: Date;
}

Notes

  • Scheduling: Set startsAt and endsAt for time-limited promotions. Both are optional — omit startsAt for immediate visibility, omit endsAt for no expiry.
  • Audience targeting: "all" shows to everyone. "authenticated" targets logged-in customers. "guest" targets anonymous visitors.
  • Display types: "bar" is a thin announcement strip (top/bottom of page). "banner" is a wider promotional block. "popup" is a modal overlay.
  • Priority: Lower numbers display first. Use reorderAnnouncements() for drag-and-drop ordering in admin UI.
  • Colors: backgroundColor and textColor accept any CSS color value including OKLCH tokens.