madmurphy / cookies.js

Simple cookie framework with full Unicode support
GNU General Public License v3.0
264 stars 54 forks source link

Export framework as a module #1

Closed pdme closed 7 years ago

pdme commented 7 years ago

This way, we can import the framework using

npm install --save madmurphy/cookies.js

import cookies from 'cookies.js'
madmurphy commented 7 years ago

Hi pdme!

The idea is good in theory, but would make cookies.js npm-centric. Any idea for solving this problem?

pdme commented 7 years ago

Do you mean it would throw an error if loaded directly in the browser?

We could solve it by checking if module exists before exporting.

I updated the pull request.

pdme commented 7 years ago

Great, thanks :)