{"_id":"postcss-svgo@9.1.0","bugs":{"url":"https://github.com/cssnano/cssnano/issues"},"dist":{"shasum":"59952c80de8256a1e36c61834c5618dc3651aad0","tarball":"http://registry-npm.ywwl.com/postcss-svgo/download/postcss-svgo-9.1.0.tgz","fileCount":9,"integrity":"sha512-DoGfu2+WpGRq+kVJu0U8mIYRaG/wD+bA3Hm18A9cVAsy24ZBpMAqeiS5pXCsnoKPYVueV9YSYvvrUgtg5z6Ycg==","signatures":[{"sig":"MEUCIQCzycpv+y5IBvIisDyznU7sDw/XikPpcGdE07Bgh7M6xwIgDd8UArJRoEAObEI5cWIvSqCXr1ongJLr/mkrChOlycw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFhUMRVm75VuAm3MmmNyVm0rDjXUuWnAi36Bg0EB0rhdAiEA54q6Nd3Ohldb++UpTJmHGhH3PeasGkwVJIAAgYG9gNk="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/postcss-svgo@9.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21057,"size":8227,"noattachment":false,"key":"/postcss-svgo/-/postcss-svgo-9.1.0.tgz"},"main":"./src/index.js","name":"postcss-svgo","type":"module","types":"./types/index.d.ts","author":{"url":"https://beneb.info","name":"Ben Briggs","email":"beneb.info@gmail.com"},"engines":{"node":"^22.22.3 || ^24.15.0 || >=26.0"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"fuzz":"node ./script/fuzz.js","test":"node --test"},"version":"9.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"e04b8fe2-f020-437e-853a-e47d52dcbd43"}},"homepage":"https://github.com/cssnano/cssnano","keywords":["css","minify","optimise","postcss","postcss-plugin","svg","svgo"],"repository":{"url":"git+https://github.com/cssnano/cssnano.git","type":"git"},"description":"Optimise inline SVG with PostCSS.","directories":{},"maintainers":[{"name":"beneb","email":"beneb.info@gmail.com"},{"name":"ludovicofischer","email":"livrerie@gmail.com"},{"name":"ai","email":"andrey@sitnik.es"},{"name":"chriseppstein","email":"chris@eppsteins.net"},{"name":"andyjansson","email":"jansson.andy@gmail.com"},{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},{"name":"cssnano-bot","email":"sahaaniketh@gmail.com"}],"dependencies":{"svgo":"^4.1.0","cssnano-utils":"^9.0.0","@csstools/css-tokenizer":"^4.0.2"},"_hasShrinkwrap":false,"devDependencies":{"postcss":"^8.5.29"},"peerDependencies":{"postcss":"^8.5.29"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-svgo_9.1.0_1791833684237_0.8974574792197494"},"readme":"# [postcss][postcss]-svgo\n\n> Optimise inline SVG with PostCSS.\n\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-svgo) do:\n\n```\nnpm install postcss-svgo --save\n```\n\n\n## Example\n\n### Input\n\n```css\nh1 {\n    background: url('data:image/svg+xml;charset=utf-8,<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"yellow\" /></svg>');\n}\n\nh2 {\n    background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iNDAiIGZpbGw9InllbGxvdyIgLz48IS0tdGVzdCBjb21tZW50LS0+PC9zdmc+');\n}\n```\n\n### Output\n\n```css\nh1 {\n    background: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"%23ff0\"/></svg>');\n}\n\nh2 {\n    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQwIiBmaWxsPSIjZmYwIi8+PC9zdmc+');\n}\n```\n\n\n## API\n\n### `svgo([options])`\n\n#### options\n\n##### encode\n\nType: `boolean`\nDefault: `undefined`\n\nIf `true`, it will encode URL-unsafe characters such as `<`, `>` and `&`;\n`false` will decode these characters, and `undefined` will neither encode nor\ndecode the original input. Note that regardless of this setting, `#` will\nalways be URL-encoded.\n\n##### configFile\n\nType: `string | boolean`\nDefault: `undefined`\n\nPath to a svgo configuration file, relative to the `cwd` option, or `true` to\nfind one the same way the SVGO CLI does: in `cwd` and then each parent\ndirectory. The `datauri` option in the file is ignored, because it only makes\nsense for the SVGO command line.\n\nThe file is read the first time the plugin runs and reused by later runs of the\nsame plugin instance. Reading a file is asynchronous, so when `configFile` is\nset, use the async PostCSS API (`process(css).then()` or `await`). The\nsynchronous API throws.\n\nInline options override the file's options key by key. Passing `js2svg` inline\nreplaces the file's whole `js2svg` object, and an inline option set to\n`undefined` does not replace the file's setting.\n\n##### cwd\n\nType: `string`\nDefault: `process.cwd()`\n\nThe directory that a relative `configFile` path is resolved against, and where\n`configFile: true` starts its search. It does not depend on the location of the\nCSS file.\n\n##### plugins\n\nOptionally, you can customise the output by specifying the `plugins` option. You\nwill need to provide the config in comma separated objects, like the example\nbelow. Note that you can either disable the plugin by setting it to `false`,\nor pass different options to change the default behaviour.\n\n```js\nconst postcss = require('postcss');\nconst svgo = require('postcss-svgo');\n\nconst opts = {\n    plugins: [{\n        name: 'preset-default',\n        params: {\n            overrides: {\n                removeComments: false,\n                cleanupNumericValues: {\n                    floatPrecision: 2\n                }\n            }\n        }\n    }]\n};\n\n\npostcss([ svgo(opts) ]).process(css).then((result) => {\n    console.log(result.css)\n});\n```\n\nYou can view the [full list of plugins here][plugins].\n\n\n## Security\n\nThis package optimises SVG data URIs; it is not an SVG sanitizer. Do not rely\non it to remove active or unsafe SVG content.\n\nSanitize user-controlled SVG with a purpose-built sanitizer before\noptimisation.\n\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/main/CONTRIBUTORS.md).\n\n\n## License\n\nMIT © [Ben Briggs](https://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n[plugins]: https://svgo.dev/docs/plugins/\n","publish_time":1791833684305,"_cnpm_publish_time":1791833684305,"dist-tags":{"latest":"9.1.0","next":"5.0.0-rc.2","nightly":"4.0.0-nightly.2020.2.6"}}