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

jquery-remember

v1.0.0

Published

*a fork of [jquery.cookie](https://github.com/carhartl/jquery-cookie)*

Downloads

22

Readme

jquery.remember

a fork of jquery.cookie

Remember stuff. A simple way to set/read/destroy cookies and localstorage.

Differences between $.cookie...

  • $.remember instead of $.cookie...
  • call using settings object. $.remember({ name: 'name', value: 'value' }) instead of params $.cookie('name', 'value')
  • sets localstorage first and falls back to cookies (browser capabilities). unless specified $.remember({ name: 'test', use: 'cookie' })
  • new options like get and set (if not set already...) $.remember({ name: 'name', value: 'value', getSet: true })
  • gets rid of amd settings from $.cookie (didn't work great for me). now you can include in require and whatever name as namespaced argument
  • complete code restructure
  • tried to preserve all of the features of $.cookie

Full Options

settings = $.extend({
    name: null,         // name/key of the cookie/localstorage item
    value: undefined,   // value pair of cookie/localstorage
    getSet: false,      // if true, will get if available, set if not. default is to just get OR set
    remove: false,      // if true, will remove based on name/key
    use: 'default',     // whether to use localstorage or cookies. default localstorage with cookie fallback.
    expires: null,      // forces cookie (invalid localstorage attribue).
    path: null,         // forces cookie.
    domain: null,       // forces cookie.
    secure: null,       // forces cookie.
    json: false,        // will convert to json when set. parse with get.
    fallback: true,     // whether to fallback to cookies if localstorage not available.
    raw: false,         // if true, will skip uri encoding/decoding
    modernizr: false    // set true if youd rather handle localstorage detection through modernizr
}, options);

Installation

Include script after the jQuery library (unless you are packaging scripts somehow else -- minify at your convenience):

<script src="/path/to/jquery.remember.js"></script>

Usage

Create localstorage item (localstorage default, can be overwritten/specified)

$.remember({ name: 'name', value: 'value' })

Create session cookie:

$.remember({ name: 'name', value: 'value', use: 'cookie' });

Create expiring cookie lasting 20 years (adding cookie specific options -- expires/path/secure/domain -- forces cookie:

$.remember({ name: 'name', value: 'value', expires: 365 * 20 });

Create localstore item (disallow cookie fallback):

$.remember({ name: 'name', value: 'value', fallback: false });

Read (will automatically fallback + check the other for named pair, unless specified):

$.remember({ name: 'name' });
$.remember({ name: 'name', use: 'cookie', fallback: false });
$.remember({ name: 'not_found' }) => null

Get or Set item:

$.remember({ name: 'name', value: 'value', getSet: true }) => will not set if already exists

Remove cookie/localstorage:

$.remember({ name: 'name', remove: true });
$.remember({ name: 'name', use: 'localstorage', fallback: false });

Configuration

TO USE WITH REQUIRE.JS

$.cookie required some editing for me. I did not want to use jquery namespace, like $.cookie(), I wanted cookie(). I recommend this setup...

define(['jquery'], function($){
  $.remember = function(options){ // (or return function(options{ ... if you want to avoid jquery namespace entirely)
  // ALL CODE, DONT TOUCH (well, unless you want to)
  return $.remember; // remove if you went the return function route...
});

// then in whatever module

require(['jquery', 'jquery.remember'], function($, remember){ // jquery not required here...but figured you probably will have it
});

// now, both these would work
$.remember({ name: 'test' });
remember({ name: 'test' });

modernizr

using modernizr is optional. a simple test is build in to detect browser support, but if you would rather use modernizr local storage, just make sure modernizr is loaded, and then call with

$.remember({ name: 'test', value: 'value', modernizr: true });

raw

By default the cookie/localstorage value is encoded/decoded when writing/reading, using encodeURIComponent/decodeURIComponent. Bypass this by raw to true:

$.remember({ name: 'name', value: 'value', raw: true });

json

Turn on automatic storage of JSON objects passed as the cookie value:

$.remember({ name: 'name', value: 'value', json: true });

Tests

Run over a server, example:

$ python -m SimpleHTTPServer

Currently very basic test setup showing functionality, would be great to build this in actual testing framework (similar to $.cookie)

If you prefer simple cookie management only, please check out the original repo at jquery.cookie

** Thanks carhartl -- original author of $.cookie