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

ngsameera-cookie

v1.0.1

Published

NgSSCookie used to manage cookies in application which is developed using angular framework. - [NPM package](https://www.npmjs.com/package/ngsameera-cookie) - [GitHub Repository](https://github.com/sameerasuresh/ngsameera-cookie) ## Installation

Readme

NgSSCookie

NgSSCookie used to manage cookies in application which is developed using angular framework.

Installation

  • Add package using npm
    npm i ngsameera-cookie --save
    or
    npm i ngsameera-cookie@latest --save

Documentation

1. Import and inject to file

In this case, used for app.component.ts .

	//app.component.ts
	import { Component } from '@angular/core';

	//import NgSSCookieService
	import { NgSSCookieService } from 'ngsameera-cookie';

	@Component({
		selector: 'app-root',
		template: `<p>ngss-cookie works!</p>`,
		styles: []
		})
		export class AppComponent {
	    /**
	   * Inject NgSSCookieService
	   * @param cookie
	   */
		 constructor(private cookie:NgSSCookieService) { }

	}

2. Save cookie


1. Save as string

Use for save only string value in cookie

  • this.cookie.save.asString(key:string,value:strng,expireDate: Date,path?:string);
  • key argument for key
  • value argument for string value
  • expireDate argument for expire date.
  • pathyou can use fourth argument to set path as string value('/api'). it is optional and default value is /.
//create expire date
var  expireDate:Date = new  Date();
expireDate.setDate(expireDate.getDate()+2);

//save
this.cookie.save.asString('key1','value1',expireDate);

2. Save as DTO

  1. create dto class file. example.dto.ts
export  class Dto{
	name:string;
	age:number;
	married:boolean
	setData(name:string,age:number,married:boolean){
		this.name = name;
		this.age = age;
		this.married = married;
	}
}
  1. Import and implement Use for save dto in cookie. cookie actually saved in cookie as JSON string.
    • this.cookie.save.asDto(key:string,dto:any | any [],expireDate: Date,path?:string);
    • key argument for key
    • dto argument for pass data source to save cookies. It can be object or object array.
    • expireDate argument for expire date.
    • you can use fourth argument to set path as string value('/api'). it is optional and default value is /.
//imort Dto
import { Dto } from './dto';	

//make dto
var  dto:Dto = new Dto();
dto.setData('Suresh',20,false);

//create expire date
var  expireDate:Date = new Date();
expireDate.setDate(expireDate.getDate()+2);

//save dto
this.cookie.save.asDto('key2',dto,expireDate);

3. Read cookie


1. Read as String

Use for read string value or DTO in cookie both. But return only string value.

  • this.cookie.get.asString(key:string);
  • key1 argument for key
//read
var  value: string = this.cookie.get.asString('key1');
console.info(value);

2. Read as DTO

Use for read only DTO cookie.

  • this.cookie.get.asDto(key:string,object:any | any[]);
  • key argument for key
  • dtostore existing cookie in dto. It can be object or object array.
//make new Dto
var  savedDto:Dto = new  Dto();

//read
this.cookie.get.asDto('key2',savedDto);
console.info(savedDto);

4. Update existing cookie


Use save function for update. If existing cookies has path, you should pass path argument(path?:string) to update it . Else path is not essential.

//create expire date

var  expireDate:Date = new  Date();
expireDate.setDate(expireDate.getDate()+2);

//update
this.cookie.save.asString('key1','updated-value1',expireDate);

5. Delete Cookie


Use for delete existing cookie. this.cookie.delete(key:string,path?:string); If existing cookies has path, you should pass path argument(path?:string) to update it . Else path is not essential.

//delete
this.cookie.delete('key1');

Creator

Suresh Sameera