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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@anowlet/cookie-consent

v1.0.2

Published

## A Simple Cookie Consent Manager

Downloads

7

Readme

Cookie Consent

A Simple Cookie Consent Manager

Actions Status styled with prettier tested with jest Commitizen friendly semantic-release

It is a Javascript based solution for blocking / allowing even 3rd party cookies to comply with GDPR & CCPA.

demo

Feature

  • Support PC and mobile cookie banner display, responsive
  • Lifecycle hooks, giving users the opportunity to add your own code at specific stages
  • Multi-lingual, supports EU language
  • Support removing unwanted cookies
  • Users can customize whether the country complies with CCPA & GDPR
  • Support different UA whether to display cookie banner
  • Hosted on AWS Cloudfront with edges around the globe for
  • Four different blocking methods

Dynamic script tags

Some services insert dynamically created script tags to the HEAD at page load. These can be intercepted and blocked.

Script tag blocking

Some third party services require you to insert a script tag into your HTML pages. These can be inactivated until the user allowes them.

Script wrapping

Some services are not inserted in a SCRIPT tag and are obscured by layers of other code. Thats why this script creates a global wrapper function what you can use to wrap and blovk any JS code.

Local cookies

Finally the local cookies set on your domain can be also filtered by overriding the bowsers COOKIE SET method.

Usage

Module

import CookieConsent from 'cookie-consent';
// or
const CookieConsent = require('cookie-consent');

Classic

<!-- Specify the version -->
<script src="./cookie-consent.umd.js"></script>
<script>
  var CookieConsent = window.CookieConsent;
</script>

Initialization

var cc = new CookieConsent({
  //...options,
});

Configuration Options

  new CookieConsent({
    language: 'en',
  });
  </script>

Instance Methods

Events

cc.on('initialized', (...args) => console.log(args));
cc.on('error', console.error);
cc.on('popupOpened', () => console.log('Popup Open'));
cc.on('popupClosed', () => console.log('Popup Closed'));
cc.on('modalOpened', () => console.log('Modal Open'));
cc.on('modalClosed', () => console.log('Modal Closed'));
cc.on('statusChanged', (...args) => console.log(args));

Browsers support

| IE / Edge | Firefox | Chrome | Safari | iOS Safari | | --------- | --------- | --------- | --------- | --------- | | IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions

NPM scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't :wink:)

Automatic releases

FAQ

Contributions of any kind are welcome!