{"name":"svgo","version":"4.0.0","keywords":["svgo","svg","optimize","minify"],"author":{"url":"https://github.com/deepsweet","name":"Kir Belevich","email":"kir@belevi.ch"},"license":"MIT","_id":"svgo@4.0.0","maintainers":[{"name":"deepsweet","email":"kir@belevi.ch"},{"name":"greli","email":"grelimail@gmail.com"},{"name":"trysound","email":"opensource@trysound.io"},{"name":"sethiii","email":"seth@falco.fun"}],"contributors":[{"url":"https://github.com/arikon","name":"Sergey Belov","email":"peimei@ya.ru"},{"url":"https://github.com/GreLI","name":"Lev Solntsev","email":"lev.sun@ya.ru"},{"url":"https://github.com/TrySound","name":"Bogdan Chadkin","email":"trysound@yandex.ru"},{"url":"https://falco.fun/","name":"Seth Falco","email":"seth@falco.fun"}],"homepage":"https://svgo.dev","bugs":{"url":"https://github.com/svg/svgo/issues"},"bin":"./bin/svgo.js","dist":{"shasum":"17e0fa2eaccf429e0ec0d2179169abde9ba8ad3d","tarball":"http://registry-npm.ywwl.com/svgo/download/svgo-4.0.0.tgz","fileCount":154,"integrity":"sha512-VvrHQ+9uniE+Mvx3+C9IEe/lWasXCU0nXMY2kZeLrHNICuRiC8uMPyM14UEaMOFA5mhyQqEkB02VoQ16n3DLaw==","signatures":[{"sig":"MEUCIQDrQGt70sk+D35ERT2NFd/xxgXjuL3uFKAq+sDN5BJrhAIgNzz1JGAsdhzfLMh00vJ2CjyfsWJ6VoNZlBK8IJac3Do=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1446765,"size":342663,"noattachment":false,"key":"/svgo/-/svgo-4.0.0.tgz"},"jest":{"coverageReporters":["html","lcov","text"],"coveragePathIgnorePatterns":["fixtures"]},"type":"module","types":"./types/lib/svgo-node.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./types/lib/svgo-node.d.ts","import":"./lib/svgo-node.js","require":"./dist/svgo-node.cjs"},"./browser":{"types":"./types/lib/svgo.d.ts","import":"./dist/svgo.browser.js"}},"funding":{"url":"https://opencollective.com/svgo","type":"opencollective"},"gitHead":"71e1f05a7efdb667ff61df53f621e8f3e48076fc","scripts":{"qa":"yarn lint && yarn test:types && yarn test && yarn test:bundles && yarn test:regression","lint":"eslint . && prettier --check .","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --maxWorkers=4 --coverage","build":"node scripts/sync-version.js && yarn build:bundles && yarn build:types","clean":"yarn clean:build && yarn clean:types","lint:fix":"eslint --fix . && prettier --write .","test:types":"yarn build:types && tsc && tsd","build:types":"yarn clean:types && tsc && tsc -p tsconfig.build.json","clean:build":"rimraf dist","clean:types":"rimraf types","test:bundles":"yarn build:bundles && node ./test/svgo.cjs && node ./test/browser.js","build:bundles":"yarn clean:build && rollup -c","prepublishOnly":"yarn clean && yarn build","test:regression":"node ./test/regression-extract.js && cross-env NO_DIFF=1 node ./test/regression.js"},"_npmUser":{"name":"sethiii","actor":{"name":"sethiii","type":"user","email":"seth@falco.fun"},"email":"seth@falco.fun"},"repository":{"url":"git://github.com/svg/svgo.git","type":"git"},"description":"SVGO is a Node.js library and command-line application for optimizing vector images.","directories":{},"resolutions":{"sax@^1.4.1":"patch:sax@npm%3A1.4.1#./.yarn/patches/sax-npm-1.4.1-503b1923cb.patch"},"dependencies":{"sax":"^1.4.1","csso":"^5.0.5","css-tree":"^3.0.1","css-what":"^6.1.0","commander":"^11.1.0","css-select":"^5.1.0","picocolors":"^1.1.1"},"_hasShrinkwrap":false,"packageManager":"yarn@3.8.7","devDependencies":{"tsd":"^0.32.0","jest":"^29.7.0","pngjs":"^7.0.0","eslint":"^9.25.1","rimraf":"^5.0.10","rollup":"^4.22.4","globals":"^14.0.0","prettier":"^3.5.3","cross-env":"^7.0.3","@eslint/js":"^9.25.1","@types/sax":"^1.2.7","pixelmatch":"^7.1.0","playwright":"^1.52.0","tar-stream":"^3.1.7","typescript":"^5.8.3","@types/csso":"^5.0.4","@types/jest":"^29.5.14","@types/node":"^22.15.3","@jest/globals":"^29.7.0","@types/css-tree":"^2.3.10","@types/tar-stream":"^3.1.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^26.0.3","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/svgo_4.0.0_1750522143071_0.21426730987403242","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <img src=\"./logo/logo-web.svg\" width=\"348.61\" height=\"100\" alt=\"\"/>\n</div>\n\n# SVGO [![npm](https://img.shields.io/npm/v/svgo)](https://npmjs.org/package/svgo) [![chat](https://img.shields.io/discord/815166721315831868)](https://discord.gg/z8jX8NYxrE) [![docs](https://img.shields.io/badge/docs-svgo.dev-blue)](https://svgo.dev/)\n\nSVGO, short for <abbr title=\"Scalable Vector Graphics\">SVG</abbr> Optimizer, 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`/`-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`/`--recursive` and `-f`/`--folder`:\n\n```sh\nsvgo -rf path/to/directory_with_svgs -o path/to/output_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://svgo.dev/docs/plugins/), and the default plugins in [Preset Default | SVGO Documentation](https://svgo.dev/docs/preset-default/).\n\nSVGO 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.\n\n**`svgo.config.mjs`**\n\n```js\nexport default {\n  multipass: false, // boolean\n  datauri: 'base64', // 'base64'|'enc'|'unenc'\n  js2svg: {\n    indent: 4, // number\n    pretty: false, // boolean\n  },\n  plugins: [\n    'preset-default', // built-in plugins enabled by default\n    'prefixIds', // enable built-in plugins by name\n\n    // 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          // disable a default plugin\n          cleanupIds: false,\n\n          // 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://svgo.dev/docs/preset-default/#plugins-list).\n\n### Custom plugins\n\nYou can also specify custom plugins:\n\n**`svgo.config.mjs`**\n\n```js\nimport importedPlugin from './imported-plugin';\n\nexport default {\n  plugins: [\n    // plugin imported from another JavaScript file\n    importedPlugin,\n\n    // 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', // recommended\n  multipass: true, // 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| [<img src=\"https://sheetjs.com/sketch128.png\" width=\"80\">](https://sheetjs.com/) | [<img src=\"https://raw.githubusercontent.com/fontello/fontello/8.0.0/fontello-image.svg\" width=\"80\">](https://fontello.com/) |\n| :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |\n|                       [SheetJS LLC](https://sheetjs.com/)                        |                                              [Fontello](https://fontello.com/)                                               |\n\n## License and Copyright\n\nThis software is released under the terms of the [MIT license](https://github.com/svg/svgo/blob/main/LICENSE).\n\nLogo by [André Castillo](https://github.com/DerianAndre).\n","publish_time":1750522143330,"_cnpm_publish_time":1750522143330,"dist-tags":{"latest":"4.1.0","rc":"4.0.0-rc.5","v2":"2.8.4","v3":"3.3.5"}}