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

cookie-warn

v3.2.17

Published

EU cookie warn

Downloads

152

Readme

Cookie Warn

EU Cookie Law warning message

npm GitHub issues Build Status npm

Maintainability Rating Security Rating Vulnerabilities Bugs

Preview

preview

Features

  • jQuery not required
  • multilanguage support
  • customizable style
  • responsive
  • Bootstrap detect
  • adjustable delay and expire days
  • callback

Examples

Example 1

  • without parameters
<html lang="en">
<script id="cookieScript" type="text/javascript" src="../cookie-warn.min.js"></script>

Example 2

  • all parameters
  • texts and links by html lang attribute
<html lang="en">
<script
    id="cookieScript"
    data-lang-en="{
          'text': 'Our website uses cookies.',
          'more_text': 'Click here for more information',
          'more_link': 'https://ec.europa.eu/info/law/law-topic/data-protection_en',
          'accept_text': 'I accept',
          'reject_text': 'I reject',
          'reject_info': 'You can disable unwanted cookies by using this program',
          'reject_link': 'https://www.ghostery.com/'
          'close_text': 'Close'
       },
    }" (optional, setup texts and links)
    data-callback="cookieWarnCallback" (callback function name, optional)
    data-debug="true" (show debug info in console, optional)
    data-expire="365" (default 365 day, optional)
    data-domain="*.domain.tld" (cookie domain, optional)
    data-path="/" (cookie path, optional)
    data-secure="true" (cookie secure https, optional)
    data-delay="750" (default 500, optional)
    data-class="customCookieWarningClass" (optional)
    data-style="#cookieScriptBox a { color: #ff0000; }" (optional)
    type="text/javascript"
    src="../cookie-warn.min.js">
</script>
<script>
      const cookieWarnCallback = function(accepted) {
            if (accepted) {
                  // do something...
            } else {
                  // do nothing...
            }
      };
</script>

Example 3

  • with default parameters
  • texts and links by html lang attribute
 <html lang="en">

 <script type="text/javascript" src="../cookie-warn.min.js"></script>

 <div
     id="cookieScript"
     data-lang-en="{
           'text':'Our website uses cookies.',
           'accept_text':'Accept all',
           'accept_essential_text':'Accept only essential',
           'more_text':'Click here for more information',
           'more_link':'https://ec.europa.eu/info/law/law-topic/data-protection_en'
     }"
     data-lang-hu="{
           'text':'Weboldalunk sütiket használ.',
           'accept_text':'Elfogadom',
           'more_text':'Kattints ide a bővebb információért',
           'more_link':'https://ec.europa.eu/info/law/law-topic/data-protection_hu'
     }">
 </div>

Todo

  • accept cookies by types (necessary, all, custom)