btmills/geopattern — pull request #3 by btmills (2014-02-28 06:23:07+00:00)
Title: Fix base64 encoding on Node.js

Browser-based base64 encoding uses `window.btoa()`, which isn't available server-side. Detect when `window.btoa()` is unavailable and use `new Buffer(str).toString('base64')` as a fallback. As long as the execution environment is either a browser or Node.js, this should work fine.