npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

imgurify

2.0.1 • Public • Published

imgurify

Browserify transform that allows you to require images -> base64* data uri's.

* base64 only for raster images, svgs are inlined as svg+xml, because reasons...

Install

npm install --save imgurify

Use

browserify -t imgurify entry.js
var pony = require('./graphics/pony.png')
console.log(pony)
// => data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcA...

Changelog

2.0.1

  • Improve SVG encoding - thanks felthy 🎉

2.0.0

  • Total rewrite
  • Reading files "manually" becuase weird browserify buffer behaviour (hoping to revert this back in the future)

1.2.2

  • Fixed incorrect mimetype for jpg

1.2.1

  • Fixed base64 encoding of large (multibuffer) raster images

1.2.0

  • Added a cli imgurify path/to/img.svg > img.js 😍

1.1.0

  • Support for svg

1.0.0

  • Initial release 🎉

enjoy.

install

npm i imgurify

Downloadsweekly downloads

333

version

2.0.1

license

BSD

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability