{"id":17034535,"url":"https://github.com/caub/svgz","last_synced_at":"2025-07-11T11:33:15.614Z","repository":{"id":151003028,"uuid":"94786488","full_name":"caub/svgz","owner":"caub","description":"Experimental replacement for SVGO","archived":false,"fork":false,"pushed_at":"2018-04-24T12:23:09.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T22:17:52.738Z","etag":null,"topics":["jsdom","svgo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-19T14:35:59.000Z","updated_at":"2020-11-14T16:13:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5478dba-b10b-4d0f-aa21-ebafe50acf10","html_url":"https://github.com/caub/svgz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/caub/svgz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fsvgz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fsvgz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fsvgz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fsvgz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caub","download_url":"https://codeload.github.com/caub/svgz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fsvgz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264795412,"owners_count":23665232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsdom","svgo"],"created_at":"2024-10-14T08:43:53.967Z","updated_at":"2025-07-11T11:33:15.592Z","avatar_url":"https://github.com/caub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SVG processor and minifier [![Build Status](https://travis-ci.org/caub/svgz.svg?branch=master)](https://travis-ci.org/caub/svgz)\n\nsimilar to [SVGO](https://github.com/svg/svgo) (most plugins are based from svgo)\n\n```js\nconst svgz = require('svgz');\nconst fs = require('fs');\n\nconst svgBuf = fs.readFileSync('./test.svg');\n// const result = svgz(svgBuf); // call it with default options\n// const result = svgz(svgBuf, {indent:'\\t', decimals:3}); // call it with different global options\n// and with specific plugins options:\nconst result = svgz(svgBuf, {\n\tindent: '\\t', \n\tdecimals: 3,\n\tplugins: {\n\t\taddDefaultFonts: {families: ['sans-serif']},\n\t\tremoveMetadata: false // disable this one\n\t}\n});\nfs.writeFileSync('./test.min.svg', result);\n```\n\n### Plugins\n\n| name | description | active |\n| --- | --- | :---: |\n| removeMetadata | removes `\u003cmetadata\u003e` elements | :heavy_check_mark: |\n| cleanupIds | removes unused id's attributes | :heavy_check_mark: |\n| cleanupViewBox | moves the viewBox origin to 0 0 (and adjust transform on children) |  |\n| moveElemsAttrsToGroup | moves up attributes (except transform) to a group wrapper | :heavy_check_mark: |\n| moveGroupAttrsToElems | moves some group attributes to the content elements | :heavy_check_mark: |\n| collapseGroups | collapses/unwrap useless groups | :heavy_check_mark: |\n| convertPathData | optimizes path data: writes in shorter form, applies transformations | :heavy_check_mark: |\n| convertTransform | collapses multiple transformations and optimizes it | :heavy_check_mark: |\n| cleanupNumericValues | rounds numeric values to the fixed precision, removes default ‘px’ units, and empty attributes | :heavy_check_mark: |\n| addDefaultFonts | ensure fallbacks font-family, useful when using web-fonts |  |\n\n### Todos:\n- improve jsdom's getComputedSyle to work with [presentational attributes](https://www.w3.org/TR/SVG2/styling.html#PresentationAttributes) (`\u003cpath stroke=\"blue\"`) and inherited attributes) or directly use [nwsapi on top of sax](https://github.com/caub/nwsapi/blob/test/test/unit.js)\n- minifyStyles\n- removeUselessStrokeAndFills\n- removeEmptyTexts\n- pathData\n- merge tranform in shapes too (circle, rect, line..) when possible and shorter\n- ... most svgo plugins and tests","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaub%2Fsvgz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaub%2Fsvgz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaub%2Fsvgz/lists"}