npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vd-tool

v4.0.2

Published

Android Studio Vector Drawable tool

Downloads

2,634

Readme

vd-tool

Packaging of the Android Studio VectorDrawable CLI tool

Pre-requisite

  • Requires Java 8 or higher

Sources

Binaries were built using the following branch: https://android.googlesource.com/platform/tools/base/+/refs/tags/studio-2020.3.1/vector-drawable-tool

Cli

$ npm install -g vd-tool
$ vd-tool

Converts SVG files to VectorDrawable XML files.
Displays VectorDrawables.
Usage: [-c] [-d] [-in <file or directory>] [-out <directory>] [-widthDp <size>] [-heightDp <size>] [-addHeader]
Options:
  -in <file or directory>:  If -c is specified, Converts the given .svg file
                            to VectorDrawable XML, or if a directory is specified,
                            all .svg files in the given directory. Otherwise, if -d
                            is specified, displays the given VectorDrawable XML file
                            or all VectorDrawables in the given directory.
  -out <directory>          If specified, write converted files out to the given
                            directory, which must exist. If not specified the
                            converted files will be written to the directory
                            containing the input files.
  -c                        If present, SVG files are converted to VectorDrawable XML
                            and written out.
  -d                        Displays the given VectorDrawable(s), or if -c is
                            specified the results of the conversion.
  -widthDp <size>           Force the width to be <size> dp, <size> must be integer
  -heightDp <size>          Force the height to be <size> dp, <size> must be integer
  -addHeader                Add AOSP header to the top of the generated XML file
Examples:
  1) Convert SVG files from <directory> into XML files at the same directory and visualize the XML file results:
  vd-tool -c -d -in <directory>
  2) Convert SVG file and visualize the XML file results:
  vd-tool -c -d -in file.svg
  3) Display VectorDrawable's XML files from <directory>:
  vd-tool -d -in <directory>

Lib

$ npm i vd-tool
const { vdConvert } = require('vd-tool')

vdConvert('path/to/svg-file-or-dir', options: {
  outDir?: string     // output dir path
  width?: number      // forces width in DP
  height?: number     // forces height in DP
  addHeader?: boolean // add AOSP header
})
.then(() => {
  //...
})
.catch(({message}) => {
  console.error('message')
})