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

@mahope/cookie-consent-banner

v1.0.1

Published

Lightweight, GDPR-compliant cookie consent banner. One script tag, zero dependencies, no tracking, ~2.5 KB.

Readme

Cookie Consent Banner

Lightweight, GDPR-compliant cookie consent banner — drop in one <script> tag, zero dependencies, no tracking, no build step. ~2.5 KB minified.

License Size Compliance

Install via npm

npm i @mahope/cookie-consent-banner

Then include node_modules/@mahope/cookie-consent-banner/banner.js in your build, or use the jsDelivr CDN tag below (@1 pins the major version).

Demo

Live demo on mahope.tools

Quick start

<script src="https://cdn.jsdelivr.net/npm/@mahope/cookie-consent-banner@1/banner.js"
        data-site-name="My Website"></script>

That's it. The banner shows once, sets a consent cookie, and hides for 365 days.

Customisation

All options are data- attributes on the <script> tag.

| Attribute | Default | Description | |-----------|---------|-------------| | data-site-name | "This website" | Your site name | | data-position | "bottom" | "bottom" or "top" | | data-accept-text | "Accept All" | Button label | | data-necessary-text | (none) | Show a "Necessary Only" button | | data-policy-url | (none) | Link to your privacy policy | | data-cookie-name | "cc_consent" | Consent cookie name | | data-storage-days | 365 | How long consent lasts |

Examples

With privacy policy link and both buttons:

<script src="https://cdn.jsdelivr.net/npm/@mahope/cookie-consent-banner@1/banner.js"
        data-site-name="My Shop"
        data-policy-url="/privacy"
        data-necessary-text="Necessary Only"
        data-accept-text="Accept All"></script>

Top-positioned banner with only accept:

<script src="https://cdn.jsdelivr.net/npm/@mahope/cookie-consent-banner@1/banner.js"
        data-site-name="Blog"
        data-position="top"></script>

Features

  • Zero dependencies — no jQuery, no external CSS, no CDN calls
  • No tracking — the script never makes network requests; consent is stored in a cookie
  • GDPR-compliant — sets a cookie with SameSite=Lax, respects user choice
  • Customisable — position, labels, links, cookie name and duration
  • Accessible — ARIA role dialog with aria-label
  • Portable — works on any site: static HTML, WordPress, Shopify, Next.js, plain PHP

GDPR / ePrivacy context

The EU ePrivacy Directive requires websites to obtain consent before storing non-essential cookies. This banner is a lightweight way to meet that requirement for compliance-conscious site owners.

For a deeper guide on cookie consent, EU compliance requirements, and how to audit your site, download the free e-book: Cookie Consent & GDPR Compliance for Web Agencies.

Related tools

  • Compliance Site Check — GitHub Action that checks any site for privacy policy, terms, cookie banner, imprint, DPA, security headers, meta tags and hreflang
  • EUcomply Scanner — CLI scanner for website compliance (GDPR, DSA, ePrivacy, security headers)
  • Free E-Books — NIS2, GDPR, EAA, and cookie consent guides in EPUB format

Releasing

npm run release -- patch (or minor/major) bumps the version, commits and pushes the tag. CI publishes to npm and creates the GitHub release.

License

MIT — use it anywhere, free and unrestricted.

Author

Built by Mads Holst Jensen — developer and technical partner for small businesses, Odense, Denmark. https://mahoje.dk