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

ff-cookies

v9.0.2

Published

[![Build Status](https://travis-ci.org/frontendfreelancerdk/ff-cookies.svg?branch=master)](https://travis-ci.org/frontendfreelancerdk/ff-cookies)

Downloads

16

Readme

Build Status

ff-cookies

Screenshot

Installing

npm install ff-cookies --save

Using

Basic

Simple usage

<ff-cookies></ff-cookies>

Also you can set up options:

<ff-cookies
<!-- You can change the default method that determines whether to display the component or not. -->
 [checkCookies]="myCheckCookies.bind(this)" 
<!-- Cookies options -->
 path="/"
 expireDays="30"
 cookieName="myCookieName"
 cookieValue="cookies accepted"
<!-- set href for link -->
 link="/cookies-politic"
<!-- set text for link -->
 linkText="cookies policy"
<!-- set text for "agree" button -->
 agreeText="Agree"
<!-- set main text -->
 description="We use cookies to ensure you the best experience. By clicking around the site you accept our "
<!-- output triggered after user click on "accept" button -->
 (accept)="myHandler($event)"
></ff-cookies>

Types and default values

  checkCookies: () => boolean;
  accept: (event: Event) => void;
  description: string = 'We use cookies to ensure you the best experience. By clicking around the site you accept our ';
  linkText: string = 'cookies policy';
  link: string = '';
  agreeText: string = 'Agree';
  path: string = '/';
  expireDays: string | number = 365;
  cookieName: string = 'myCookieName';
  cookieValue: string = 'cookies accepted';

Styling

You can change default styles. That can be used to target the override

.ff-cookies-wrapper{
// styles for wrapper
}
.ff-cookies-description{
// styles for description
}

.ff-cookies-more{
// styles for link 
}

.ff-cookies-agree{
// styles for accept button
}

Version 9.X.X

Since version 9.0.0 we added two more components: ff-cookies-modal and ff-cookies-advanced.

Notice! ff-cookies-modal component is not ready yet. You can use it as experimental.

ff-cookies-advanced

Screenshot

Component looks like simple ff-cookies, but it can be expanded and show details about cookies you use, your cookies politic (without adding additional page) and user will be able to choose what cookies your web site may use.

Usage

<ff-cookies-advanced [description]="description"
                     [linkText]="linkText" [link]="link"
                     [agreeText]="agreeText"
                     (accepted)="log($event)"
                     [cookiesSet]="cookiesSet"
                     [mainTabsTitle]="['Declaration', 'About cookies']">
    <div aside>Some text for declaration aside bar should be marked by 'aside' attr</div>
    <div body>Main text of cookies declaration (cookies politic)  should be marked by 'body' attr</div>
</ff-cookies-advanced>

Pay attention to two new properties cookiesSet and mainTabsTitle, also to content inside component!

import {Component} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {ICookiesSet} from 'ff-cookies';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'ff-cookies';
  description = 'We use cookies to ensure you the best experience. By clicking around the site you accept our ';
  linkText = 'cookies policy';
  link = 'cookies';
  agreeText = 'Ok';

// Important!!!
  cookiesSet: ICookiesSet;

  constructor(private http: HttpClient) {
    this.http.get('/assets/cookies.json').subscribe((json: ICookiesSet) => {
      this.cookiesSet = json;
    });
  }

  log(cookies) {
    console.log(cookies);
  }
}

Interfaces


export interface ICookie {
  name: string;
  provider: string;
  purpose: string;
  expiry: string;
  dataProcessor: string;
  dataProcessorPrivacyPolicy: string;
  type: string;
}

//the same as ICookie but for opportunity use some translations for titles
export interface ICookieTitles {
  name: string;
  provider: string;
  purpose: string;
  expiry: string;
  dataProcessor: string;
  dataProcessorPrivacyPolicy: string;
  type: string;
}

export interface ICookiesGroup {
  id: number;
  name: string;
  cookies: ICookie[];
  description: string;
  titles: ICookieTitles;
  required?: boolean;
}

export interface ICookiesSet {
  groups: ICookiesGroup[];
}