New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gulp-avif

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-avif

gulp plugin for convert images from png or jpg to avif

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
287
11.67%
Maintainers
1
Weekly downloads
 
Created
Source

GULP-AVIF

This is gulp plugin for convertation PNG and JPG images to AVIF

GULP-AVIF based to lib sharp

Usage

const gulp = require('gulp');
const gulpAvif = require('gulp-avif');

gulp.task('default', ()=>{
    return gulp.src('./from/*.{png,jpg,svg}')
        .pipe(gulpAvif())
        .pipe(gulp.dest('./to/'));
});

Example based integration AVIF

<picture>
    <source type="image/avif" srcset="./to/show.avif" />
    <source type="image/webp" srcset="./to/show.webp" />
    <img src="./to/show.png">
</picture>

API

gulpAvif(options?)

options Object ? output options

  • options.quality number quality, integer 1-100 (optional, default 90)
  • options.lossless boolean use lossless compression (optional, default false)
  • options.speed boolean CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default 5)
  • options.chromaSubsampling string set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling, requires libvips v8.11.0 (optional, default '4:2:0')

only for SVG

  • options.width number output image width (optional, default 64)
  • options.height number output image height (optional, default depend of width, if width empty - 64). If the image ratio less original image will cutted.

Throws Error Invalid options

Releases

v 1.1.1

  • Removed unneed console.log

v 1.1.0

  • Added support SVG source file
  • Update depencency after Dependabot alert.

Keywords

gulpplugin

FAQs

Package last updated on 16 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts