Minimalist (<10 LOC), performant, clientside cookie reader module and nothing else. It is tolerant of being required server-side. It will simply returns
null if called within node.
Dead simple function that has the best performance according to: http://jsperf.com/cookie-parsing
Handy to have as a separate module for easy installation with npm.
npm install cookie-getter
var cookies = ;// returns the value of the cookie if it's just a simple stringvar username = ;// if the cookie is a JSON string it will parse it as welluser = ;console; // logs out name of firstName value if encoded as JSON in cookie.