Socket
Book a DemoInstallSign in
Socket

@forward-software/gulp-sharp

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forward-software/gulp-sharp

Custom plugin for gulp toolkit to convert images using sharp library

1.0.2
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

gulp-sharp

Custom plugin for gulp toolkit to convert images using sharp library.

Usage

Install this plugin and the required peer dependencies

$ npm install --save-dev gulp sharp @forward-software/gulp-sharp

Each exported plugin can handle all formats supported by sharp.

[!NOTE] Unsupported files are ignored and passed through.

JPEG

Convert images to JPEG format

import gulp from 'gulp';
import { jpeg as gulpJpeg } from "@forward-software/gulp-sharp";

export default () => (
  gulp.src('src/image.jpg')
    .pipe(gulpJpeg({ quality: 90 }))
    .pipe(gulp.dest('dist'))
);

API

jpeg(options?)
  • options.extensions, Array of file extensions to convert, if not specified the following will be used: ["avif", "gif", "jpg", "jpeg", "png", "svg", "tif", "tiff", "webp"].
  • All options available to sharp jpeg method.

PNG

Convert images to PNG format

import gulp from 'gulp';
import { png as gulpPng } from "@forward-software/gulp-sharp";

export default () => (
  gulp.src('src/image.jpg')
    .pipe(gulpPng({ palette: true }))
    .pipe(gulp.dest('dist'))
);

API

png(options?)
  • options.extensions, Array of file extensions to convert, if not specified the following will be used: ["avif", "gif", "jpg", "jpeg", "png", "svg", "tif", "tiff", "webp"].
  • All options available to sharp png method.

TIFF

Convert images to TIFF format

import gulp from 'gulp';
import { tiff as gulpTiff } from "@forward-software/gulp-sharp";

export default () => (
  gulp.src('src/image.jpg')
    .pipe(gulpTiff({ quality: 90 }))
    .pipe(gulp.dest('dist'))
);

API

tiff(options?)
  • options.extensions, Array of file extensions to convert, if not specified the following will be used: ["avif", "gif", "jpg", "jpeg", "png", "svg", "tif", "tiff", "webp"].
  • All options available to sharp tiff method.

WebP

Convert images to WebP format

import gulp from 'gulp';
import { webp as gulpWebp } from "@forward-software/gulp-sharp";

export default () => (
  gulp.src('src/image.jpg')
    .pipe(gulpWebp({ preset: "drawing" }))
    .pipe(gulp.dest('dist'))
);

API

webp(options?)
  • options.extensions, Array of file extensions to convert, if not specified the following will be used: ["avif", "gif", "jpg", "jpeg", "png", "svg", "tif", "tiff", "webp"].
  • All options available to sharp webp method.

License

MIT

Made with ✨ & ❤️ by ForWarD Software and contributors

Keywords

gulp

FAQs

Package last updated on 16 Apr 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.