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

@zerakicreative/cookie-consent

v1.0.3

Published

A GDPR-compliant, globally-supported cookie consent banner widget by Zeraki

Readme

@zerakicreative/cookie-consent

A beautiful, GDPR-compliant cookie consent widget with GSAP animations. Supports CCPA, LGPD, PDPA, POPIA, PIPEDA and Google Analytics Consent Mode v2 out of the box.

Install

npm install @zerakicreative/cookie-consent

Quick start

ES Module (React / Vue / Svelte / TypeScript)

import { CookieBanner } from '@zerakicreative/cookie-consent';

new CookieBanner({
  logo:             '/logo.png',
  primaryColor:     '#2563EB',
  privacyPolicyUrl: '/privacy',
  cookiePolicyUrl:  '/cookies',
  googleAnalytics: {
    measurementId:      'G-XXXXXXXXXX',
    consentModeVersion: 'v2',
    autoLoad:           true,
  },
}).init();

Script tag (CDN / self-hosted)

<!-- Before </body> -->
<script src="https://cdn.jsdelivr.net/npm/@zerakicreative/cookie-consent/dist/zeraki-cookie-consent.iife.js"></script>
<script>
  ZerakiCookieBanner.init({
    primaryColor:     '#2563EB',
    privacyPolicyUrl: '/privacy',
    cookiePolicyUrl:  '/cookies',
  });
</script>

Configuration

new CookieBanner({
  // Branding
  logo:             '/logo.png',       // URL to your logo image
  companyName:      'Your Company',    // Used in modal and aria labels

  // Legal links
  privacyPolicyUrl: '/privacy',
  cookiePolicyUrl:  '/cookies',

  // Appearance
  primaryColor:     '#2563EB',         // Any CSS colour value
  theme:            'light',           // 'light' | 'dark' | 'auto'
  position:         'bottom-bar',      // See positions below
  customStyles:     '',                // Inject extra CSS

  // Floating cookie button
  showFloatingButton:     true,
  floatingButtonPosition: 'bottom-right', // 'bottom-right' | 'bottom-left'

  // Behaviour
  autoShow:          true,             // Show banner on first visit
  autoDetectRegion:  true,             // Auto-detect regulation by timezone
  forcedRegion:      'gdpr',           // Override: 'gdpr' | 'ccpa' | 'lgpd' | 'pdpa' | 'pipeda' | 'popia' | 'other'
  cookieExpiry:      365,              // Days before consent expires
  consentVersion:    '1',             // Bump to re-prompt after policy changes

  // Google Analytics
  googleAnalytics: {
    measurementId:      'G-XXXXXXXXXX',
    tagManagerId:       'GTM-XXXXXXX', // Optional — GTM instead of direct GA
    consentModeVersion: 'v2',          // 'v1' | 'v2'
    autoLoad:           true,          // Load GA script automatically
  },

  // Callbacks
  onReady:         ()          => {},
  onConsentChange: (consent)   => console.log(consent),
  onAcceptAll:     (consent)   => {},
  onRejectAll:     ()          => {},
}).init();

Banner positions

| Value | Description | |---|---| | bottom-bar | Full-width bar at the bottom (default) | | top-bar | Full-width bar at the top | | bottom-left | Floating card, bottom-left | | bottom-right | Floating card, bottom-right | | bottom-center | Floating card, bottom-center |

Consent object

The onConsentChange callback receives a ConsentState:

{
  necessary:   true,           // always true
  analytics:   boolean,
  marketing:   boolean,
  preferences: boolean,
  timestamp:   string,         // ISO 8601
  version:     string,
  region?:     RegionCode,
}

Custom translations

new CookieBanner({
  translations: {
    bannerTitle: 'We value your privacy',
    bannerText:  'We use cookies to improve your experience.',
    acceptAll:   'Accept all',
    rejectAll:   'Reject all',
    customize:   'Manage preferences',
    categories: {
      analytics: {
        name:        'Analytics',
        description: 'Help us understand how visitors use our site.',
      },
    },
  },
}).init();

Programmatic control

const banner = new CookieBanner({ ... }).init();

banner.show();           // Show the consent banner
banner.hide();           // Hide the banner
banner.showModal();      // Open the preferences modal
banner.acceptAll();      // Accept all categories
banner.rejectAll();      // Reject all non-essential
banner.getConsent();     // Returns current ConsentState | null
banner.resetConsent();   // Clear saved consent and re-show banner

License

MIT © Zeraki