Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

avocado

> 编程语言
Open source

Vector Drawable optimization tool

1.4K stars0 likes0 views
WebsiteGitHub

About

Vector Drawable optimization tool

avocado

avocado is a command line tool (similar to svgo) that optimizes Android VectorDrawable (VD) and AnimatedVectorDrawable (AVD) xml files.

Installation

You can install avocado using npm w/ the following command:

npm install -g avocado

Usage

Usage: avocado [options] [file]

Options:

  -V, --version          output the version number
  -s, --string <string>  input VD or AVD string
  -i, --input <file>     input file/directory, or "-" for STDIN
  -o, --output <file>    output file/directory (same as the input file by default), or "-" for STDOUT
  -d, --dir <dir>        optimizes and rewrite all *.xml files in a directory
  -q, --quiet            only output error messages
  -h, --help             output usage information

Examples

…

avocado rewrites the VectorDrawable using the smallest number of <group>s and <path>s possible, reducing their file sizes and making them faster to parse and draw at runtime. The example below shows the contents of a VectorDrawable before and after being run through avocado.

Before

…

After

…

Build instructions

If you want to contribute, first be sure to install the latest version of Node.js and npm. If you're not sure what IDE to use, I highly recommend checking out vscode.

Then clone this repository and in the root directory, run:

npm install

To build the tool, run:

npm run build

To test the tool, run:

npm run test

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •TypeScript
  • •android
  • •animated-vector-drawable
  • •vector-drawable

> Tags

TypeScriptandroidanimated-vector-drawablevector-drawable

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言