Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benboba/svg-slim
A cool svg optimization tool that supports the svg standard
https://github.com/benboba/svg-slim
compress minify optimization svg svg-optimization
Last synced: 3 months ago
JSON representation
A cool svg optimization tool that supports the svg standard
- Host: GitHub
- URL: https://github.com/benboba/svg-slim
- Owner: benboba
- License: mit
- Created: 2018-08-10T09:25:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-07T03:17:02.000Z (almost 3 years ago)
- Last Synced: 2024-09-18T08:49:55.800Z (5 months ago)
- Topics: compress, minify, optimization, svg, svg-optimization
- Language: TypeScript
- Homepage: https://benboba.github.io/svg-slim-web
- Size: 8.16 MB
- Stars: 75
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README-cn.md
- Changelog: CHANGELOG-cn.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - benboba/svg-slim - A cool svg optimization tool that supports the svg standard (TypeScript)
README
# SVG瘦身工具【svg slim】
[![npm version](https://badge.fury.io/js/svg-slim.svg)](https://badge.fury.io/js/svg-slim)
## 更新日志
[查看更新日志](./CHANGELOG-cn.md)
## 简介
SVG瘦身工具是一款提供了丰富自定义功能的 SVG 压缩工具,遵循 W3C 的 [SVG 规范](https://www.w3.org/TR/SVG/)
## 安装
```
npm install svg-slim
```或者
```
yarn add svg-slim
```## 使用
```js
import svgSlim from 'svg-slim';
svgSlim(svgcode[, config]).then(result => {
console.log(result);
});
```其中 svgcode 为字符串格式的 svg 文本,config 为用户自定义的[优化配置](docs/cn/config.md)
### 优化配置
查看主条目[优化配置](docs/cn/config.md)
### 在线使用
[svg-slim-web](https://benboba.github.io/svg-slim-web/)
### 使用 svg-slim-loader
[svg-slim-loader](https://github.com/benboba/svg-slim-loader) 是 webpack 的 loader 插件,支持对 import 的 SVG 文件进行优化
### 使用 postcss-svg-slim
[postcss-svg-slim](https://github.com/benboba/postcss-svg-slim) 是 postcss 的插件,支持优化 CSS 中内联的 SVG
### 使用 rollup-plugin-svg-slim
[rollup-plugin-svg-slim](https://github.com/benboba/rollup-plugin-svg-slim) 是 rollup 的插件,支持在 rollup 中优化 SVG
## 为什么选择 svg-slim?
* 丰富而强大的功能,足够个性化的配置参数
* 追求极致的优化效果
* 尽可能不破坏原有的 svg 效果
* 遵循最新的 svg 规范# 捐助项目
如果你觉得这个项目对你有帮助,欢迎提供赞助。
[](https://www.paypal.com/paypalme/benboba)