Socket
Socket
Sign inDemoInstall

cookie-policy

Package Overview
Dependencies
386
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cookie-policy

A script and style sheet that displays a cookie policy notification


Version published
Weekly downloads
9
increased by200%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

By default, this project contains the scripts and styles to display the a cookie policy notification on a web page.

You can use it to display a custom cookies message of your choosing on your own web page.

Usage

This project can be installed from an NPM package.

Options

You can configure the cookie policy with the following options.

Message:

You can edit to cookie policy message by passing the setup function an options object with a content value. For example:

var options = {
  content: 'We use cookies to improve your experience.',
};
Timed destruction

You can make the cookie policy self-destruct in time by passing a duration value as an option. Duration is measured in milliseconds.

var options = {
  duration: 3000,
};

Note: It is recommended you add a link to your cookie policy in the footer of your website when using this option.

Full example
var options = {
  content:
    'We use cookies to improve your experience. By your continued use of this site you accept such use.<br /> This notice will disappear by itself.',
  duration: 3000,
};
cpNs.cookiePolicy.setup(options);

Contributing

If you would like to help improve this project, here is a list of commands to help you get started.

Install the requisite dependencies;

npm install

To build the JS and CSS into the build folder, run:

npm run build

You can view the build files in action by opening the index.html in the root of this project.

Hacking

When developing this project you can run the following command to listen to changes in the src/js/*js and src/sass/*scss folders and build them into the /build folder.

npm run watch

Before submitting your pull request, run the linters, which checks both the JS and Sass for errors.

npm run test

Code licensed LGPLv3 by Canonical Ltd.

With ♥ from Canonical

FAQs

Last updated on 12 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc