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

thin-mint

v1.0.3

Published

HTTP cookie utility

Downloads

12

Readme

thin-mint

Current Version Build Status via Travis CI Dependencies devDependencies

HTTP cookie utility. thin-mint provides parsing and stringification of individual HTTP cookies.

Example

var ThinMint = require('thin-mint');
var str = 'foo=bar; domain=continuation.io; path=/baz; expires=Sun, 20 Mar 2016 07:05:03 GMT; max-age=1234; secure; httponly';
var cookie = new ThinMint(str);

/*
cookie = {
  name: 'foo',
  value: 'bar',
  domain: 'continuation.io',
  path: '/baz',
  secure: true,
  httpOnly: true,
  expires: 1458457503000,
  maxAge: 1234,
  expiration: 1441772074919,
  input: {
    cookie: 'foo=bar; domain=continuation.io; path=/baz; expires=Sun, 20 Mar 2016 07:05:03 GMT; max-age=1234; secure; httponly',
    name: 'foo',
    value: 'bar',
    domain: 'continuation.io',
    path: '/baz',
    secure: 'secure',
    httpOnly: 'httponly',
    expires: 'Sun, 20 Mar 2016 07:05:03 GMT',
    maxAge: '1234'
  }
}
*/

console.log(cookie.toString());

Methods

Cookie(cookieStr) Constructor

  • Arguments
    • cookieStr (string) - An HTTP cookie
  • Constructs
    • object - An object representation of the cookieStr argument with the following schema:
      • name (string) - The cookie name. Defaults to null.
      • value (string) - The cookie value, as parsed by decodeURIComponent()``. Defaults to null`.
      • domain (string) - The cookie domain, converted to lowercase. Defaults to null.
      • path (string) - The cookie path, which must begin with /. Defaults to null.
      • secure (boolean) - The cookie's secure attribute. Defaults to false.
      • httpOnly (boolean) - The cookie's httpOnly attribute. Defaults to false.
      • expires (number) - The cookie's expires attribute passed through Date.parse(). Defaults to Infinity.
      • maxAge (number) - The cookie's max-age attribute. Defaults to Infinity.
      • expiration (number) - The cookie's expiration time. Uses max-age, or falls back to expires. Defaults to Infinity if neither are provided.
      • input (object) - An object containing the raw input values without any processing. Contains the following properties.
        • cookie (string) - The original string passed to the constructor.
        • name (string) - The cookie name. Defaults to null.
        • value (string) - The cookie value. Defaults to null.
        • domain (string) - The cookie domain. Defaults to null.
        • path (string) - The cookie path. Defaults to null.
        • secure (string) - The cookie's secure attribute. Defaults to null.
        • httpOnly (string) - The cookie's httpOnly attribute. Defaults to null.
        • expires (string) - The cookie's expires attribute. Defaults to null.
        • maxAge (string) - The cookie's max-age attribute. Defaults to null.

Cookie.prototype.toRequestCookie()

  • Arguments
    • None
  • Returns
    • string - Request cookie string representation of the cookie. If the cookie has a value, then the string will be of the form name=value, where value is encoded using encodeURIComponent(). If the cookie has no value, then the string is just the cookie name.

Converts the Cookie into a request cookie string.

Cookie.prototype.toString()

  • Arguments
    • None
  • Returns
    • string - String representation of the cookie containing all fields.

Creates a string representation of the Cookie object.