gulp-generate-image-data-uri
Gulp plugin that generates Data URIs for images
Last updated a year ago by ackellyb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-generate-image-data-uri 
SYNC missed versions from official npm registry.

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, 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.

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:

const camelCaseFileName = 'dataURI';

Credit

This plugin would not be possible without the Node module datauri, which is used to generate the datauris

License

MIT © Aaron Kelly-Barker

Current Tags

  • 1.1.0                                ...           latest (a year ago)

3 Versions

  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 4
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |