[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3080":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},3080,"svgo","svg\u002Fsvgo","svg","⚙️ Node.js tool for optimizing SVG files","https:\u002F\u002Fsvgo.dev",null,"JavaScript",22527,1448,237,184,0,3,12,55,10,44.48,"MIT License",false,"main",[26,27,28,29,30,7,5],"cli","javascript","minification","nodejs","optimization","2026-06-12 02:00:46","\u003Cdiv align=\"center\">\n  \u003Cimg src=\".\u002Flogo\u002Flogo-web.svg\" width=\"348.61\" height=\"100\" alt=\"\"\u002F>\n\u003C\u002Fdiv>\n\n# SVGO [![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fsvgo)](https:\u002F\u002Fnpmjs.org\u002Fpackage\u002Fsvgo) [![chat](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F815166721315831868)](https:\u002F\u002Fdiscord.gg\u002Fz8jX8NYxrE) [![docs](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-svgo.dev-blue)](https:\u002F\u002Fsvgo.dev\u002F)\n\nSVGO, short for **SVG O**ptimizer, is a Node.js library and command-line application for optimizing SVG files.\n\n## Why?\n\nSVG 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.\n\n## Installation\n\nYou can install SVGO globally through npm, yarn, or pnpm. Alternatively, drop the global flag (`global`\u002F`-g`) to use it in your Node.js project.\n\n```sh\n# npm\nnpm install -g svgo\n\n# yarn\nyarn global add svgo\n\n# pnpm\npnpm add -g svgo\n```\n\n## Command-line usage\n\nProcess single files:\n\n```sh\nsvgo one.svg two.svg -o one.min.svg two.min.svg\n```\n\nProcess a directory of files recursively with `-r`\u002F`--recursive` and `-f`\u002F`--folder`:\n\n```sh\nsvgo -rf path\u002Fto\u002Fdirectory_with_svgs -o path\u002Fto\u002Foutput_directory\n```\n\nHelp for advanced usage:\n\n```sh\nsvgo --help\n```\n\n## Configuration\n\nSVGO has a plugin architecture. You can read more about all plugins in [Plugins | SVGO Documentation](https:\u002F\u002Fsvgo.dev\u002Fdocs\u002Fplugins\u002F), and the default plugins in [Preset Default | SVGO Documentation](https:\u002F\u002Fsvgo.dev\u002Fdocs\u002Fpreset-default\u002F).\n\nSVGO reads the configuration from `svgo.config.mjs` or the `--config path\u002Fto\u002Fconfig.mjs` command-line option. Some other parameters can be configured though command-line options too.\n\n**`svgo.config.mjs`**\n\n```js\nexport default {\n  multipass: false, \u002F\u002F boolean\n  datauri: 'base64', \u002F\u002F 'base64'|'enc'|'unenc'\n  js2svg: {\n    indent: 4, \u002F\u002F number\n    pretty: false, \u002F\u002F boolean\n  },\n  plugins: [\n    'preset-default', \u002F\u002F built-in plugins enabled by default\n    'prefixIds', \u002F\u002F enable built-in plugins by name\n\n    \u002F\u002F enable built-in plugins with an object to configure plugins\n    {\n      name: 'prefixIds',\n      params: {\n        prefix: 'uwu',\n      },\n    },\n  ],\n};\n```\n\n### Default preset\n\nInstead of configuring SVGO from scratch, you can tweak the default preset to suit your needs by configuring or disabling the respective plugin.\n\n**`svgo.config.mjs`**\n\n```js\nexport default {\n  plugins: [\n    {\n      name: 'preset-default',\n      params: {\n        overrides: {\n          \u002F\u002F disable a default plugin\n          cleanupIds: false,\n\n          \u002F\u002F customize the params of a default plugin\n          inlineStyles: {\n            onlyMatchedOnce: false,\n          },\n        },\n      },\n    },\n  ],\n};\n```\n\nYou can find a list of the default plugins in the order they run in [Preset Default | SVGO Documentation](https:\u002F\u002Fsvgo.dev\u002Fdocs\u002Fpreset-default\u002F#plugins-list).\n\n### Custom plugins\n\nYou can also specify custom plugins:\n\n**`svgo.config.mjs`**\n\n```js\nimport importedPlugin from '.\u002Fimported-plugin';\n\nexport default {\n  plugins: [\n    \u002F\u002F plugin imported from another JavaScript file\n    importedPlugin,\n\n    \u002F\u002F plugin defined inline\n    {\n      name: 'customPlugin',\n      params: {\n        paramName: 'paramValue',\n      },\n      fn: (ast, params, info) => {},\n    },\n  ],\n};\n```\n\n## API usage\n\nSVGO provides a few low level utilities.\n\n### optimize\n\nThe core of SVGO is `optimize` function.\n\n```js\nimport { optimize } from 'svgo';\n\nconst result = optimize(svgString, {\n  path: 'path-to.svg', \u002F\u002F recommended\n  multipass: true, \u002F\u002F all other config fields are available here\n});\n\nconst optimizedSvgString = result.data;\n```\n\n### loadConfig\n\nIf you write a tool on top of SVGO you may want to resolve the `svgo.config.mjs` file.\n\n```js\nimport { loadConfig } from 'svgo';\n\nconst config = await loadConfig();\n```\n\nYou can also specify a path and customize the current working directory.\n\n```js\nconst config = await loadConfig(configFile, cwd);\n```\n\n## Donors\n\n| [\u003Cimg src=\"https:\u002F\u002Fsheetjs.com\u002Fsketch128.png\" width=\"80\">](https:\u002F\u002Fsheetjs.com\u002F) | [\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Ffontello\u002Ffontello\u002F8.0.0\u002Ffontello-image.svg\" width=\"80\">](https:\u002F\u002Ffontello.com\u002F) |\n| :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |\n|                       [SheetJS LLC](https:\u002F\u002Fsheetjs.com\u002F)                        |                                              [Fontello](https:\u002F\u002Ffontello.com\u002F)                                               |\n\n## License and Copyright\n\nThis software is released under the terms of the [MIT license](https:\u002F\u002Fgithub.com\u002Fsvg\u002Fsvgo\u002Fblob\u002Fmain\u002FLICENSE).\n\nLogo by [André Castillo](https:\u002F\u002Fgithub.com\u002FDerianAndre).\n","SVGO是一个用于优化SVG文件的Node.js工具。它通过移除冗余信息如编辑器元数据、注释、隐藏元素等来减小SVG文件大小，同时保持渲染效果不变。具备命令行界面和插件架构，支持自定义配置以满足不同需求。适用于需要提高网页加载速度或减少带宽消耗的场景，特别适合前端开发人员在处理大量SVG图形时使用。",2,"2026-06-11 02:52:24","top_language"]