ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 169 forks source link

CommonJS support #3

Closed jakobmattsson closed 12 years ago

jakobmattsson commented 12 years ago

Thanks for finally writing a lib for something I keep rewriting over and over again in every project! :)

I've added support for CommonJS, used by node.js and its package manager npm. That way servers simulating browsers (for tests or other reasons) can install and run Cookies.js. Additionally, tools like browserify can be used in order to install Cookies.js in a browser in a modular way.

Since the name "cookies" is already taken for some server-side cookie-tool, I've suggested the name "client-cookies" for the module itself, but you can change it in package.json if you prefer something else.

If you're not familiar with npm already, you can publish your package by simply running "npm publish" from the Cookies-directory (after installing node.js).

Cheers!

jakobmattsson commented 12 years ago

By the way, just realized I did not update cookies.min.js. Just a heads up.

ScottHamper commented 12 years ago

Thanks, Jakob!