1.1.2 • Published 8 years ago

gulp-tobase64 v1.1.2

Weekly downloads
14
License
MIT
Repository
github
Last release
8 years ago

gulp-tobase64

NPM version Build Status Coverage Status

A simple gulp plugin, used to transform image into base64 string.

Install

npm install gulp-tobase64

Usage

var tobase64 = require("gulp-tobase64");
tobase64(options);

Example

var tobase64 = require("gulp-tobase64");
gulp.task('build-html' , function(){
  return gulp.src("./html-init/**/*.html")
      .pipe(tobase64({
          maxsize:0.5,        
          ignore:'image_loading.png',
          pathrep: {
              reg:/\/public\/bizapp\d*\//g ,
              rep:'./public/'
          }
      }))
      .pipe(gulp.dest("./html"))
});

API

maxsize

The max size of images for compiling, the default value is 1 and the unit is 'KB'

ignore

Ignore files, it can be string, array or regular.

'image' , ['image','abc'] or /\/abc\//g

pathrep

Transform file path into readable path like this :

/public/bizapp1007/image.png ==> ./public/image.png

Running test

make test

License

MIT

1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago