# gulp-generate-image-data-uri

> Gulp plugin that generates Data URIs for images

Latest version **1.1.0** (published 2019-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-generate-image-data-uri
pnpm add gulp-generate-image-data-uri
yarn add gulp-generate-image-data-uri
bun add gulp-generate-image-data-uri
```

## 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.1.0 |
| Published | 2019-05-08 |
| First published | 2016-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aaron Kelly-Barker |
| Maintainers | ackellyb |
| Keywords | gulp, image, datauri, uri, picture, base64, data-uri, gulpplugin, plugin |

## Links

- npm: https://www.npmjs.com/package/gulp-generate-image-data-uri
- Repository: https://github.com/ackellyb/gulp-generate-image-data-uri
- Homepage: https://github.com/ackellyb/gulp-generate-image-data-uri#readme
- Issues: https://github.com/ackellyb/gulp-generate-image-data-uri/issues
- npm.io page: https://npm.io/package/gulp-generate-image-data-uri

## Dependencies (4)

- [datauri](https://npm.io/package/datauri.md) ^2.0.0
- [through2](https://npm.io/package/through2.md) ^3.0.1
- [camelcase](https://npm.io/package/camelcase.md) ^5.3.1
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-05-08
- 1.0.1 — 2016-12-15
- 1.0.0 — 2016-12-15

## README

# gulp-generate-image-data-uri

> Does exactly as it says on the tin. A gulp plugin to generate datauris for images.

## Install
I use [Yarn](https://github.com/yarnpkg/yarn), and love it. I totally recommend using it as well!

To install via Yarn:
```
$ yarn add gulp-generate-image-data-uri -D
```
To install via npm:
```
$ npm install gulp-generate-image-data-uri -D
```


## Usage

As with most Gulp plugins, this is relatively easy to set up. 

```js
const gulp = require('gulp');
const dataURI = require('gulp-generate-image-data-uri');

gulp.task('default', () =>
	gulp.src('src/img.jpg')
		.pipe(dataURI())
		.pipe(gulp.dest('dist'))
);
```
This will output a file, img.txt, which contains the data-uri.

## API

### datauri([options])

#### options

##### isJS

Type: `boolean`  
Default: `false`

Outputs datauris to JS instead, one defintion per file. The format being:
```js
const camelCaseFileName = 'dataURI';
```

## Credit ##
This plugin would not be possible without the Node module [datauri](https://github.com/data-uri/datauri), which is used to generate the datauris
## License

MIT © Aaron Kelly-Barker

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