Skip to content

voltace/browser-cookies-shim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browser-cookies-shim

This is a shim for the tiny cookies library browser-cookies

NPM Version Build Status

This shim allows browser-cookies to run on node, though it won't actually set/get/erase any cookies at all. It's mainly useful in case javascipt client code needs to be executed on node without raising any errors (see voltace/browser-cookies#3 for the rationale).

Installation

Using NPM

npm install browser-cookies-shim
npm install browser-cookies

Usage

Require browser-cookies-shim instead of browser-cookies in your application code:

var cookies = require('browser-cookies-shim');

cookies.set('name', 'Lisa'); // May call any of the browser-cookies functions

Now add the following to the package.json in your project:

{
  "browser": {
    "browser-cookies-shim": "browser-cookies"
  }
}

This setup will ensure browsers will load browser-cookies while node will load browser-cookies-shim.

About

Shim for browser-cookies

Resources

License

Stars

Watchers

Forks

Packages

No packages published