Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T10:35:49.000Z (5 months ago)
- Last Synced: 2024-09-26T03:50:28.957Z (5 months ago)
- Topics: base64, gulp, gulp-lqip, gulpplugin, image, lqip
- Language: JavaScript
- Homepage:
- Size: 335 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.
[![npm (scoped)](https://img.shields.io/npm/v/gulp-lqip-base64.svg?style=flat-square)](https://www.npmjs.com/package/gulp-lqip-base64)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com)
[![Travis (.com)](https://img.shields.io/travis/com/exuanbo/gulp-lqip-base64/master.svg?style=flat-square)](http://travis-ci.com/exuanbo/gulp-lqip-base64)
[![David](https://img.shields.io/david/exuanbo/gulp-lqip-base64.svg?style=flat-square)](https://david-dm.org/exuanbo/gulp-lqip-base64)
[![License](https://img.shields.io/github/license/exuanbo/gulp-lqip-base64.svg?style=flat-square)](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