Vector Drawable & Animated Vector Drawable optimization tool
npm install avocado[![Build status][travis-badge]][travis-badge-url]
[![npm version][npm-badge]][npm-badge-url]
[![Coverage status][coveralls-badge]][coveralls-badge-url]
avocado is a command line tool (similar to [svgo][svgo]) that optimizes AndroidVectorDrawable (VD) and AnimatedVectorDrawable (AVD) xml files.
You can install avocado using [npm][npm] w/ the following command:
``sh`
npm install -g avocado
`text
Usage: avocado [options] [file]
Options:
-V, --version output the version number
-s, --string
-i, --input
-o, --output
-d, --dir
-q, --quiet only output error messages
-h, --help output usage information
`
`shOptimize (and overwrite) a VD/AVD file.
avocado vector.xml
avocado rewrites the VectorDrawable using the smallest number of s and 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
`xml
`#### After
`xml
`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][vscode].Then clone this repository and in the root directory, run:
`sh
npm install
`To build the tool, run:
`sh
npm run build
`To test the tool, run:
`sh
npm run test
`` [travis-badge]: https://travis-ci.org/alexjlockwood/avocado.svg?branch=master
[travis-badge-url]: https://travis-ci.org/alexjlockwood/avocado
[coveralls-badge]: https://coveralls.io/repos/github/alexjlockwood/avocado/badge.svg?branch=master
[coveralls-badge-url]: https://coveralls.io/github/alexjlockwood/avocado?branch=master
[npm-badge]: https://badge.fury.io/js/avocado.svg
[npm-badge-url]: https://www.npmjs.com/package/avocado
[svgo]: https://github.com/svg/svgo
[vscode]: https://code.visualstudio.com/
[npm]: https://www.npmjs.com/get-npm