{"_id":"svgo@4.1.0","bin":{"svgo":"bin/svgo.js"},"bugs":{"url":"https://github.com/svg/svgo/issues"},"dist":{"shasum":"c977eb69640ef232a5e8236a5a327ed8c9d52853","tarball":"http://registry-npm.ywwl.com/svgo/download/svgo-4.1.0.tgz","fileCount":154,"integrity":"sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==","signatures":[{"sig":"MEUCIFQlgviqHYS7AOyKGUa4sHP1bnh/UHusVx+y2kax6WziAiEA97NxVFNFg1dES8kYnNbgkLa9cQLsi9mCWDlqOjdaE+g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDElfhcfSdt+TJdNZjnMz6qdSf0rjAmSCkN5Hvamn8D3gIhAP36WIKRCD274DtYNWUj7UcxPWUSDN+syztbJMgiDmS+"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/svgo@4.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1494938,"size":353198,"noattachment":false,"key":"/svgo/-/svgo-4.1.0.tgz"},"name":"svgo","type":"module","_from":"file:svgo-4.1.0.tgz","types":"./types/lib/svgo-node.d.ts","author":{"url":"https://github.com/deepsweet","name":"Kir Belevich","email":"kir@belevi.ch"},"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"},"license":"MIT","scripts":{"qa":"pnpm lint && pnpm typecheck && pnpm test && pnpm test:bundles && pnpm test:regression","lint":"eslint . && prettier --check .","test":"vitest run","build":"node scripts/sync-version.js && pnpm build:bundles && pnpm build:types","clean":"pnpm clean:build && pnpm clean:types","lint:fix":"eslint --fix . && prettier --write .","typecheck":"tsc","spellcheck":"cspell -u .","build:types":"pnpm clean:types && tsc -p tsconfig.build.json","clean:build":"rimraf dist","clean:types":"rimraf types","test:bundles":"pnpm build:bundles && node ./test/svgo.cjs && node ./test/browser.js","build:bundles":"pnpm clean:build && rollup -c","test:regression":"node ./test/regression/extract.js && node ./test/regression/optimize.js && node ./test/regression/compare.js --no-diff"},"version":"4.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2067e1ae-572b-4be1-ac6b-6afa0337416c"}},"homepage":"https://svgo.dev","keywords":["svgo","svg","optimize","minify"],"_resolved":"/tmp/be30cf24d1c249e5fe1d933358bac28b/svgo-4.1.0.tgz","_integrity":"sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==","repository":{"url":"git://github.com/svg/svgo.git","type":"git"},"_npmVersion":"11.17.0","description":"SVGO is a Node.js library and command-line application for optimizing vector images.","directories":{},"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"}],"_nodeVersion":"24.19.0","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":"opensource@trysound.io"},{"url":"https://falco.fun/","name":"Seth Falco","email":"seth@falco.fun"}],"dependencies":{"sax":"1.6.1","csso":"^5.0.5","css-tree":"^3.0.1","css-what":"^7.0.0","commander":"^11.1.0","css-select":"^6.0.0","picocolors":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"pngjs":"^7.0.0","cspell":"^10.0.1","eslint":"^10.8.1","rimraf":"^6.1.3","rollup":"^4.62.4","vitest":"^4.1.10","globals":"^17.9.0","prettier":"^3.9.6","tinypool":"^2.1.0","@eslint/js":"^10.0.1","@types/sax":"^1.2.7","pixelmatch":"^7.2.0","playwright":"1.62.1","tar-stream":"^3.2.0","typescript":"^7.0.2","@types/csso":"^5.0.4","@types/node":"^26.2.0","@types/pngjs":"^6.0.5","@types/css-tree":"^2.3.10","@types/tar-stream":"^3.1.4","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-commonjs":"^29.0.3","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/svgo_4.1.0_1787573436470_0.1251652854976204"},"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":1787573436576,"_cnpm_publish_time":1787573436576,"dist-tags":{"latest":"4.1.0","rc":"4.0.0-rc.5","v2":"2.8.4","v3":"3.3.5"}}