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

crumbsjs

v0.2.1

Published

A lightweight, intuitive, Vanilla ES6 fueled JS cookie library

Readme

🍪 CrumbsJS 🍪

A lightweight, intuitive, vanilla ES6 fueled JS cookie and local storage library.

Quick Start

Adding a single cookie or a local storage key

// Cookie
crumbs.set("Operating System","Win10"); // => true

// Local storage key
crumbs.ls.set("Operating System","Win10") // => true

Adding a single cookie that will expire in 7 days for a specific path

// The "expires" parameter is capable of taking a number, and will default as days.
crumbs.set("Name","Roy Azaeev",{type:"day",value:7},"/crumbsjs"); // => true

Adding a few cookies at once

const my_cookies = [];
my_cookies.push({name:"Operating System",value:"Win10"});
my_cookies.push({name:"Age",value:"29"});

crumbs.set(my_cookies); // => [{name:"Operating System",value:"Win10"},{name:"Age",value:"29"}]

Adding a few local storage keys at once

const my_localstorage_array = [];
my_localstorage_array.push({"key":"Operating System","value":"Win10"});
my_localstorage_array.push({"key":"Age","value":"29"});

crumbs.set(my_localstorage_array); // => [{key:"Operating System",value:"Win10"},{key:"Age",value:"29"}]

Get a cookie or a local storage key value

// Cookie
let age = crumbs.get("Age"); // => "29"

// Local storage
let age = crumbs.ls.get("Age"); // => "29"

Get all cookies or all local storage keys in a key-value pair object

// Cookies
let all_cookies = crumbs.getAll(); // => [{name:"Operating System",value:"Win10"},{name:"Age",value:"29"}]

// Local storage
let all_localstorage = crumbs.ls.getAll(); // => [{key:"Operating System",value:"Win10"},{key:"Age",value:"29"}]

Delete a single cookie or local storage key

// Cookie
crumbs.delete("Operating system"); // => true

// Local storage
crumbs.ls.delete("Operating system"); // => true

Delete a few cookies at once

const my_cookies = [];
my_cookies.push("Operating system");
my_cookies.push("Age");

crumbs.delete(my_cookies); // => true

Features

  • NO DEPENDENCIES - Yup, no jQuery.
  • ES5 compatible.
  • Tested, using Jest.
  • Add one or multiple cookies or local storage keys at once
  • Update cookies or local storage keys using the set method
  • Delete one or multiple cookies at once
  • Delete local storage keys easily
  • Display a cookie or a local storage key value
  • Display all cookies or local storage keys in a key-value easy to read object
  • Fallback to cookies when localstorage is not available (Safari private browsing)

Methods

set(name, value, [expires], [domain])

Sets one or more cookies.

name can be set as an array of key-pair objects in the format of {name:"Age",value:29} for mass cookie set


get(name)

Gets a cookie value by its name.


getAll()

Gets all the cookies in a key-pair object array.


delete(name)

Deletes a cookie by its name.

name can be set as an array of strings for mass delete of cookies


deleteAll()

Deletes all cookies.

Getting Started

Install On your local PC

Using a bundler ?

You can import CrumbsJS like that

import crumbs from 'crumbsjs';

Download Sources

use npm

npm install crumbsjs

use git

git clone https://github.com/nirtz89/crumbsjs.git

What's next

  • IndexDB support
  • Session storage support

Contributers

alt text alt text alt text

Thank you for making the library better!