vinyl-smallest-jpeg
v1.0.0
Published
Create a vinyl object of smallest JPEG
Downloads
14
Maintainers
Readme
vinyl-smallest-jpeg
Create a vinyl file object of theoretically smallest JPEG
var vinylSmallestJpeg = require('vinyl-smallest-jpeg');
var fixture = vinylSmallestJpeg();
fixture.contents; //=> <Buffer ff d8 ff e0 00 10 4a 46 49 ...>
fixture.contents.length; //=> 125
It is useful to test image-related gulp plugins.
Installation
npm install vinyl-smallest-jpeg
API
var vinylSmallestJpeg = require('vinyl-smallest-jpeg');
vinylSmallestJpeg([option])
option: Object
Return: Object
(vinyl file object)
It creates a vinyl object whose contents
property is a buffer of smallest JPEG (125 bytes).
option
buffer
Type: Boolean
Default: true
If you set this option false
, contents
property becomes a Readable Stream which emits a JPEG chunk.
var vinylSmallestJpeg = require('vinyl-smallest-jpeg');
vinylSmallestJpeg().isBuffer(); //=> true
vinylSmallestJpeg({buffer: false}).isStream(); //=> true
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT License.