https://github.com/exuanbo/gulp-lqip-base64
Parses HTML files to find <img> tags and adds an attribute to them which contains their Base64 representation
https://github.com/exuanbo/gulp-lqip-base64
base64 gulp gulp-lqip gulpplugin image lqip
Last synced: 7 days ago
JSON representation
Parses HTML files to find <img> tags and adds an attribute to them which contains their Base64 representation
- Host: GitHub
- URL: https://github.com/exuanbo/gulp-lqip-base64
- Owner: exuanbo
- License: mit
- Created: 2020-04-22T01:37:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-21T23:20:07.000Z (4 months ago)
- Last Synced: 2025-04-16T11:59:46.545Z (12 days ago)
- Topics: base64, gulp, gulp-lqip, gulpplugin, image, lqip
- Language: JavaScript
- Homepage:
- Size: 339 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-lqip-base64
> Parses HTML files to find `
` tags and adds an attribute to them which contains their Base64 representation.
[](https://www.npmjs.com/package/gulp-lqip-base64)
[](https://standardjs.com)
[](http://travis-ci.com/exuanbo/gulp-lqip-base64)
[](https://david-dm.org/exuanbo/gulp-lqip-base64)
[](https://github.com/exuanbo/gulp-lqip-base64/blob/master/LICENSE)## Demo
## Install
```shell
npm install --save-dev gulp-lqip-base64
```## Usage
```javascript
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
```javascript
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](https://github.com/Johann-S/gulp-image-lqip) for the inspiration.
## License
[MIT](https://github.com/exuanbo/gulp-lqip-base64/blob/master/LICENSE)
## Donate