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

@takisrs/cookies-consent

v1.0.7

Published

A simple cookies consent implementation

Readme

A simple cookies consent implementation

Demo

to be updated

Installation

Include the javascript and css files in your HTML document.

<link href="dist/cookies-consent.css" rel="stylesheet">
<script src="dist/cookies-consent.min.js"></script>

Usage

Init cookies popup dialog

Check if the user has already give his consent, otherwise init the popup. You may pass an object to overwrite the defaults.

if (!cookiesConsent.hasConsentCookie())
    cookiesConsent.init({
        cookieName: "cookies",
        rootClass: "cookies",
        cookieDuration: 60 * 60 * 24 * 365,
        containerEl: "body",
        title: "This website uses cookies",
        description: "We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. By browsing our website, you consent to our use of cookies and other tracking technologies.",
        buttonApprove: "Accept",
        buttonManage: "Preferences",
        buttonSave: "Save",
        subtitle: "Manage your cookie preferences",
        categories: [
            {
                name: 'necessary',
                checked: true,
                disabled: true,
                title: 'Necessary cookies',
                description: 'Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.'
            },
            {
                name: 'statistics',
                checked: false,
                disabled: false,
                title: 'Statistic cookies',
                description: 'Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.'
            },
            {
                name: 'marketing',
                checked: false,
                disabled: false,
                title: 'Marketing cookies',
                description: 'Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.'
            }
        ];
    });

Check if cookies are enabled for a specific category

if (cookiesConsent.isEnabled('statistics')){
    console.log("Statistic cookies are enabled!");
}