kahnvex/cookie-monster

Refactoring and future maintenance

Opened this issue · 0 comments

I'm still using the old version of Cookie monster in some of my projects but the version 0.2.1 is fairly outdated and non-maintained. I'd like to refactor it in a proper ES6 format and bundle it into different formats using Rollup. If you give me an ok, I'll prepare the pull request for version 1.0. Additionally, I'm also interested in maintaining the package since, well, I'm using it already and had contributed to it in the past.

Change proposal:

  • Refactor to ES6
  • Expose cookie-monster class instead of an instance that is implicitly initialised with global document object
  • Deprecate legacy .get(), .set() and .remove() methods
  • Implement .key(n) method and .length property to completely conform to localStorage API
  • Add argument type checks to .getItem() and .removeItem()
  • Use Rollup + Buble to build modules in all necessary formats (ESM, commonjs and universal)
  • Replace Karma + Mocha + Chai bundle with Jest for testing to decrease the number of explicit development dependencies