npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-svgo

v3.0.1

Published

Optimizing SVG vector graphics files with Gulp

Readme

gulp-svgo

NPM Version NPM Downloads Build Status

Optimizing SVG vector graphics files with Gulp

A thin wrapper around svgo for Gulp. Will pass through any non-svg files unaltered so you can use it in conjunction with other image optimization tools if you don't want a separate task for different file formats.

Requires Node.js 22.18 or newer (gulp-svgo >=3.0.0). For older Node.js versions, use gulp-svgo 2.x.

Install

$ pnpm add -D gulp-svgo

Usage

import gulp from 'gulp'
import svgo from 'gulp-svgo'

export const images = () =>
    gulp.src('src/img/*')
        .pipe(svgo())
        .pipe(gulp.dest('dest/img'))

CommonJS gulpfiles work too — const svgo = require('gulp-svgo').

Options

Options are passed directly to svgo optimize() and use the svgo v4 configuration format:

svgo({
    plugins: [
        {
            name: 'preset-default',
            params: {
                overrides: {
                    removeDoctype: false,
                },
            },
        },
    ],
})

Behavior

  • Null files (e.g. from gulp.src(..., { read: false })), pathless files, empty files, and non-svg files pass through untouched.
  • Stream-backed file contents are not supported and emit an error.
  • SVGs that fail to parse emit a stream error (with the original error as cause) instead of being silently dropped, so broken files fail your build.
  • svgo is an optimizer, not a sanitizer. Do not treat optimized SVGs from untrusted sources as safe browser content.

Migrating from v2

  • Node.js 22.18+ is required.
  • Options now use the svgo v2+ format shown above. The v1 shorthand (plugins: [{ removeDoctype: false }]) no longer works, and cleanupIDs is now cleanupIds.
  • Malformed SVGs now fail the stream instead of being silently dropped (v2.2.1 and earlier) or logged and passed through (v2.3.0). Handle the error in your task if you want to continue past bad files.
  • Optimized output differs from svgo 1.x (e.g. attributes are sorted, viewBox is preserved by default).