gulp-base64-img
v0.1.1
Published
A gulp plugin for encoding images to base64
Downloads
5
Readme
gulp-base64img
A gulp plugin for encoding images to base64
Info
Encodes images to base64 using base64-img
Install
$ npm install --save-dev gulp-base64img
Usage
const gulp = require('gulp');
const base64img = require('gulp-base64img');
gulp.task('default', () => {
gulp.src('src/file.ext')
.pipe(base64img())
.pipe(gulp.dest('dist'))
);
Combining with other plugins
const gulp = require('gulp');
const append = require('gulp-append');
const base64img = require('gulp-base64img');
const nameFromPath = require('name-from-path');
gulp.task('default', () => {
return gulp.src('img/*').pipe(base64img()).pipe(append('test.json', {
transform: {
name: function(file) {
return nameFromPath(file, true);
}
}
}))
});
API
base64img([options])
options
foo
Type: boolean
Default: false
Lorem ipsum.
License
MIT © Glenn Vandeuren