Skip to content

This plugin converts a set of images to base64 encoded datauris and combines them in a single json file.

Notifications You must be signed in to change notification settings

raoulus/gulp-base64-data-uris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp plugin example

convert images to datauris with gulp

This plugin converts a set of images to base64 encoded datauris and combines them in a single json file.

Note: This is a demo of a gulp plugin and not published to any public repository.

Usage

const convert = require('./index.js');
gulp.task('convert', function() {
  return gulp.src('./images/*')
              .pipe(convert('images.json'))
              .pipe(gulp.dest('./tmp'));
});

Result images.json

{
  "icon_sad.gif": "data:image/gif;base64...",
  "icon_smile.gif": "data:image/gif;base64...",
  "icon_wink.gif": "data:image/gif;base64..."
}

Test

gulp test

About

This plugin converts a set of images to base64 encoded datauris and combines them in a single json file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published