# gulp-datasrc-html

> Replace src, srcset to data-src, data-srcset supports lazzyloading

Latest version **1.0.6** (published 2021-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-datasrc-html
pnpm add gulp-datasrc-html
yarn add gulp-datasrc-html
bun add gulp-datasrc-html
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-04-09 |
| First published | 2021-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bladhard |
| Maintainers | bladhard |
| Keywords | gulp, gulpplugin, gulp-data, gulp-data-src, gulp-data-srcset, src, srcset |

## Links

- npm: https://www.npmjs.com/package/gulp-datasrc-html
- Repository: https://github.com/Bladhard/gulp-datasrc-html
- Homepage: https://github.com/Bladhard/gulp-datasrc-html#readme
- Issues: https://github.com/Bladhard/gulp-datasrc-html/issues
- npm.io page: https://npm.io/package/gulp-datasrc-html

## Dependencies (3)

- [vinyl](https://npm.io/package/vinyl.md) ^2.2.1
- [through2](https://npm.io/package/through2.md) ^4.0.2
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2021-04-09
- 1.0.5 — 2021-04-08
- 1.0.4 — 2021-04-08
- 1.0.3 — 2021-04-08
- 1.0.2 — 2021-04-08
- 1.0.1 — 2021-04-08
- 1.0.0 — 2021-04-08

## README

# gulp-datasrc-html

> Replace `src`, `srcset` to `data-src`, `data-srcset` supports [LazyLoading](https://github.com/Bladhard/lazy-loading)

[![npm (scoped)](https://img.shields.io/npm/v/gulp-datasrc-html.svg?style=flat-square)](https://www.npmjs.com/package/gulp-datasrc-html)
[![dependencies Status](https://status.david-dm.org/gh/Bladhard/gulp-datasrc-html.svg)](https://david-dm.org/Bladhard/gulp-datasrc-html)
[![License](https://img.shields.io/github/license/bladhard/gulp-datasrc-html.svg?style=flat-square)](https://github.com/Bladhard/gulp-datasrc-html/blob/main/LICENSE)
## Install

```npm
npm i --save-dev gulp-datasrc-html
```

## Example

```html
// Input
<img src="./img/img-1.jpg">
<picture>
    <source srcset="./img/img-1.webp" type="image/webp">
    <img src="./img/img-1.jpg">
</picture>

// Output
<img data-src="./img/img-1.jpg">
<picture>
    <source data-srcset="./img/img-1.webp" type="image/webp">
    <img data-src="./img/img-1.jpg">
</picture>
```

## Usage

```javascript
var dataHTML = require('gulp-datasrc-html');

gulp.task('html',function(){
    gulp.src('./assets/**/*.html')
        .pipe(dataHTML({ ignore: true, tags: 'header' }))
        .pipe(gulp.dest('./public/'))
});
```

## Options

### ignore

```javascript
true - Enables tag-based ignoring
false - by default
```

### tags

```html
<header></header> - tag-based ignoring by default
```

## Donate

<a href="https://www.buymeacoffee.com/bladhard" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="38.25px" width="162.75px"></a>

---
_Source: https://npm.io/package/gulp-datasrc-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
