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

@n-ramos/cookie-consent

v1.1.3

Published

RGPD-compliant cookie consent manager with CDN WebComponent and NPM API

Readme

🍪 @n-ramos/cookie-consent

npm version npm downloads release codecov Gestionnaire de consentement cookies RGPD / CNIL compliant, moderne, léger et totalement configurable.
Alternative open-source à Axeptio / Didomi, sans SaaS ni dépendance externe.


✨ Fonctionnalités

  • RGPD / CNIL compliant
  • Google Consent Mode v2
  • Activation différée des scripts (type="text/plain")
  • Nettoyage automatique des cookies
  • UI entièrement personnalisable (textes + classes)
  • Compatible Laravel 10–12 / Vite / Tailwind
  • WebComponent autonome (CDN)
  • Aucun cookie déposé par défaut

📦 Installation

npm

pnpm add @n-ramos/cookie-consent
import { initCookieWall } from '@n-ramos/cookie-consent';

CDN (WebComponent)

<script
  defer
  src="https://unpkg.com/@n-ramos/[email protected]/dist/cookie-consent-standalone.js"
></script>
<cookie-consent config='{"categories":[...]}'></cookie-consent>

🚀 Utilisation rapide

const client = initCookieWall({
  storageKey: 'my-consent',
  categories: [
    { key: 'essential', title: 'Essentiels', required: true },
    { key: 'analytics', title: 'Analytics', googleConsentMode: 'analytics_storage' },
  ],
  vendors: { googleConsentMode: { enabled: true } },
});

if (!client.hasStoredConsentForCurrentVersion()) {
  client.open();
}

⚙️ Configuration complète

CookieWallConfig

{
  storageKey?: string;
  categories: ConsentCategoryConfig[];
  vendors?: VendorConfig;
  cookieCleanup?: CookieCleanupConfig;
  ui?: CookieWallUIConfig;
}

Catégories

{
  key: string;
  title: string;
  description?: string;
  required?: boolean;
  googleConsentMode?: string | string[];
}

Vendors

vendors: {
  googleConsentMode?: {
    enabled: boolean;
  }
}

Nettoyage des cookies

cookieCleanup: {
  analytics: ["_ga", "_gid", "_clck"],
  ads: ["IDE", "_fbp"]
}

UI – Textes

ui: {
  texts: {
    title?: string;
    description?: string;
    acceptAllLabel?: string;   // "Tout accepter"
    rejectAllLabel?: string;   // "Tout refuser"
    saveLabel?: string;        // "Valider" — si défini, affiche un bouton qui persiste l'état courant des toggles
    customizeLabel?: string;   // "Personnaliser"
  }
}

UI – Classes

ui: {
  classes: {
    backdrop?: string;
    container?: string;
    title?: string;
    description?: string;
    buttonPrimary?: string;
    buttonSecondary?: string;
    buttonSave?: string;       // classe du bouton "Valider" — fallback sur buttonPrimary si absent
    buttonGhost?: string;
    categoryCard?: string;
    toggleTrackOn?: string;
    toggleTrackOff?: string;
    toggleKnob?: string;
    advancedContainer?: string;
  }
}

🧩 Activation différée des scripts

<script type="text/plain" data-cookie-category="analytics">
  console.log("Activé après consentement");
</script>

🧠 API Client

client.open();
client.close();
client.getState();
client.hasStoredConsent();
client.hasStoredConsentForCurrentVersion();
client.reset();

📚 Documentation détaillée

  • docs/CONFIG_REFERENCE.md
  • docs/INTEGRATIONS.md

📄 Licence

MIT © Nicolas Ramos