Browserify tranform to turn images into base64 data uri
npm install imgurifyBrowserify transform that allows you to require images -> base64\* data uri's.
\* base64 only for raster images, svgs are inlined as svg+xml, because reasons...
``bash`
npm install --save imgurify
`bash`
browserify -t imgurify entry.js
`javascript`
var pony = require('./graphics/pony.png')
console.log(pony)
// => data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcA...
* Improve SVG encoding - thanks felthy :tada:
* Total rewrite
* Reading files "manually" becuase weird browserify buffer behaviour (hoping to revert this back in the future)
* Fixed incorrect mimetype for jpg
* Fixed base64 encoding of large (multibuffer) raster images
* Added a cli imgurify path/to/img.svg > img.js` :heart_eyes:
* Support for svg
* Initial release :tada:
enjoy.