HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
svg
svgo
JavaScript2012–2026
svg / svgo

svgo

SVG Optimizer for Node.js and CLI. ⚙️

23Distinct people
26Mentions
0Explicit recommenders
22.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

SVG Optimizer for Node.js and CLI. ⚙️

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year26 dated mentions

Observed mentions: 2012-12-06 09:27:22 UTC to 2026-08-01 10:01:42 UTC.

0123452012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC312
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC505
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC505
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC211
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC220

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
SVGO SVGO, short for SVG Optimizer, is a Node.js library and command-line application for optimizing SVG files. 💖 Sponsor SVGO on Open Collective to support continued improvements in stability and performance. Why? SVG files, especially those exported from vector editors, usually contain a lot of redundant information. This includes editor metadata, comments, hidden elements, default or suboptimal values, and other stuff that can be safely removed or converted without impacting rendering. Installation You can install SVGO globally through npm, yarn, or pnpm. Alternatively, drop the global flag (global/-g) to use it in your Node.js project. # npm npm install -g svgo # yarn yarn global add svgo # pnpm pnpm add -g svgo Command-line usage Process single files: svgo one.svg two.svg -o one.min.svg two.min.svg Process a directory of files recursively with -r/--recursive and -f/--folder: svgo -rf path/to/directory_with_svgs -o path/to/output_directory Help for advanced usage: svgo --help Configuration SVGO has a plugin architecture. You can read more about all plugins in Plugins | SVGO Documentation, and the default plugins in Preset Default | SVGO Documentation. SVGO reads the configuration from svgo.config.mjs or the --config path/to/config.mjs command-line option. Some other parameters can be configured though command-line options too. svgo.config.mjs export default { multipass: false, // boolean datauri: 'base64', // 'base64'|'enc'|'unenc' js2svg: { indent: 4, // number pretty: false, // boolean }, plugins: [ 'preset-default', // built-in plugins enabled by default 'prefixIds', // enable built-in plugins by name // enable built-in plugins with an object to configure plugins { name: 'prefixIds', params: { prefix: 'uwu', }, }, ], }; Default preset Instead of configuring SVGO from scratch, you can tweak the default preset to suit your needs by configuring or disabling the respective plugin. svgo.config.mjs export default { plugins: [ { name: 'preset-default', params: { overrides: { // disable a default plugin cleanupIds: false, // customize the params of a default plugin inlineStyles: { onlyMatchedOnce: false, }, }, }, }, ], }; You can find a list of the default plugins in the order they run in Preset Default | SVGO Documentation. Custom plugins You can also specify custom plugins: svgo.config.mjs import importedPlugin from './imported-plugin'; export default { plugins: [ // plugin imported from another JavaScript file importedPlugin, // plugin defined inline { name: 'customPlugin', params: { paramName: 'paramValue', }, fn: (ast, params, info) => {}, }, ], }; API usage SVGO provides a few low level utilities. optimize The core of SVGO is optimize function. import { optimize } from 'svgo'; const result = optimize(svgString, { path: 'path-to.svg', // recommended multipass: true, // all other config fields are available here }); const optimizedSvgString = result.data; loadConfig If you write a tool on top of SVGO you may want to resolve the svgo.config.mjs file. import { loadConfig } from 'svgo'; const config = await loadConfig(); You can also specify a path and customize the current working directory. const config = await loadConfig(configFile, cwd); License and Copyright This software is released under the terms of the MIT license. Logo by André Castillo.
Read the full README on GitHub

What Hacker News says

26 sources
That appears to be trigged by "-32-32" (broken) vs "-32 -32" (working). Looks like this has been a long-standing weirdness in Firefox[1] where it is allowed somewhere but not other places. On the other hand, the spec[2] does specify whitespace or commas between the viewbox numbers. I rescind my 115 claim and reset it back to 116. [1] https://github.com/svg/svgo/issues/12 [2] "a list of four numbers <min-x>, <min-y>, <width> and <height>, separated by whitespace and/or a comma"
In Tell HN: The “Y” logo in the top-left corner has been upgraded to SVG
You're being modest. This is easily the most performant option... although it means losing interactivity (right clicking equations on GitHub allows copy to clipboard, A11y features, etc). Running the JS client side, like GitHub, means blocking the thread. You're either going to be 1. delaying other JS from running, or 2. rendering late, shifting the layout – which is what GitHub has chosen: https://imgur.com/a/y47haf9 (Sending the rendered div's is a non-starter. Large document sizes delay domContentLoaded, slow down browsers, aren't shared cacheable resources, etc.) Your approach, then. On your page there are 178 SVGs. Total gzipped size is 490KB. SVGO[0] gets that down to 311KB – that's 1.74KB transferred per equation. These are non-blocking, immutable, cacheable assets. Brilliant. Upgrades: - Figure out viewbox and inline height/width
Read the rest
values on the HTML so no layout jank (aka "Cumulative Layout Shift"/CLS) occurs. Unsure if this is possible for inline math. - Add `loading="lazy"` afterwards. Users that don't scroll the entire length of the page won't suffer unneeded downloads, and the inlined sizes will prevent late CLS for those that do. - Maybe re-add interactivity? Cheap option: just support copying alt-text in a context menu. [0] https://github.com/svg/svgo
In Render mathematical expressions in Markdown On GitHub
Often, you can considerably reduce the file size of an SVG text file without a noticeable reduction in perceptual quality just by reducing the precision of the coordinates. The awesome SVG Optimizer [1] has a filter (cleanupNumericValues) to process SVG files to a fixed precision. The equally awesome SVG Optimizer Missing Gui (SVGOMG) [2] provides a web-based GUI [3] to interactively adjust precision and see the resulting render (and file-size). [1] https://github.com/svg/svgo [2] https://github.com/jakearchibald/svgomg [3] https://jakearchibald.github.io/svgomg
In SVG passthrough precision
> It's the responsibility of "svgo" to make sure it's direct dependencies are alright. No, it's your responsibility to make sure your dependency tree is alright. Your personal definition of 'alright' may be more easily satisfied if the packages you choose to depend on autonomously practice some level of responsibility towards their own dependencies. Choose wisely. But there is no way to dictate your requirements to dependencies, or impose some kind of responsibility or demand some kind of warranty. You can accept what is offered, or not. In fact, if you are using svgo, even indirectly, you have agreed to this: https://github.com/svg/svgo/blob/main/LICENSE >THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Read the rest
NONINFRINGEMENT. So svgo doesn't have to care and you can't make them. Even if they do care, there's no guarantee they will meet your standards - and you still can't make them. If you want someone to blame, find someone willing to sign a contract that says you can blame them. Efforts within NPM and github to control this situation are simply the bare minimum of case-by-case disaster mitigation, in the interest of reputation alone. If you're using their infrastructure, you apparently find this acceptable.
In What NPM should do to stop a new colors attack
Unfortunately the reference to the actual minifier, SVGO (https://github.com/svg/svgo), is buried in the middle of the post. SVGO is an incredible project driven by a single volunteer in spare time (originally Kir Belevich https://twitter.com/deepsweet , and for the last few years Lev Solntsev https://twitter.com/ruGreLI). It's the type of project you probably use regularly behind another tool like Sketch or SVGOMG (https://jakearchibald.github.io/svgomg/). They accept donations (https://www.paypal.me/deepsweet) and you should definitely consider contributing if you find it useful.
In Minify Your SVGs
ImageTracer is a simple raster image tracer and vectorizer that outputs SVG, 100% free, Public Domain. Available in JavaScript (works both in the browser and with Node.js), "desktop" Java and "Android" Java: https://github.com/jankovicsandras/imagetracerjs https://github.com/jankovicsandras/imagetracerjava https://github.com/jankovicsandras/imagetracerandroid You can use svgo to optimize the SVG afterwards: https://github.com/svg/svgo
In Super Tiny Website Logos in SVG

Showing the 15 most recent of 26 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.