Wondering what’s next for npm?Check out our public roadmap! »

gulp-lqip-base64

1.1.1 • Public • Published

gulp-lqip-base64

Parses HTML files to find <img> tags and adds an attribute to them which contains their Base64 representation.

npm (scoped) JavaScript Style Guide Travis (.com) David License

Demo

https://exuanbo.github.io/gulp-lqip-base64/

Install

npm install --save-dev gulp-lqip-base64

Usage

const { task, src, dest } = require('gulp')
const lqipBase64 = require('gulp-lqip-base64')
 
task('default', () => {
  return src('**/*.html', { base: '.' })
    .pipe(lqipBase64({ attribute: 'srcset' }))
    .pipe(dest('.'))
})

or you can

import lqipBase64 from 'gulp-lqip-base64'

Supported image types

Currently ['jpeg', 'jpg', 'png', 'bmp', 'tiff', 'gif'] are supported.

Options

Type: Object

srcAttr

  • Type: String
  • Default: src

Attribute which contain the image path.

attribute

  • Type: String
  • Default: data-src

Attribute which will contain the Base64 representation of the image.

Acknowledgement

Thanks gulp-image-lqip for the inspiration.

License

MIT

Donate

Buy Me A Coffee

Install

npm i gulp-lqip-base64

DownloadsWeekly Downloads

7

Version

1.1.1

License

MIT

Unpacked Size

53.2 kB

Total Files

18

Last publish

Collaborators

  • avatar