{"_id":"@abd3lraouf/vec2drawable","_rev":"3-9c09492c67c087ef0010db53893b4599","name":"@abd3lraouf/vec2drawable","dist-tags":{"latest":"1.1.4"},"versions":{"1.0.0":{"name":"@abd3lraouf/vec2drawable","version":"1.0.0","keywords":["android","vector","drawable","svg","vd-tool","vec2drawable","converter"],"author":{"name":"abd3lraouf","email":"https://github.com/abd3lraouf"},"license":"MIT","_id":"@abd3lraouf/vec2drawable@1.0.0","maintainers":[{"name":"abd3lraouf","email":"abdelraoufsabri@gmail.com"}],"homepage":"https://github.com/abd3lraouf/vec2drawable#readme","bugs":{"url":"https://github.com/abd3lraouf/vec2drawable/issues"},"bin":{"vec2drawable":"cli.js"},"dist":{"shasum":"8ec0e0d4129ad1cd8f15490f6dafab63bd6ed6fa","tarball":"https://registry.npmjs.org/@abd3lraouf/vec2drawable/-/vec2drawable-1.0.0.tgz","fileCount":23,"integrity":"sha512-SRh9G7vp2NbtLDJj1GQxKDDp4NGR2CNHpQaldTPfYrifOvrzoOtlmuBsFFglBA4JVU1cRLQCUGTLX9powZYrGg==","signatures":[{"sig":"MEQCIFT/sIjR+qMH8o7sPVd9Vk7iTUMTK38Xrv/LNE/DymEYAiAfyg380e57I35flwxb49CC0W5draD7TcDMGlVJzBsl3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54710},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"f34a2f7a2e75dfc948d1d0955a8f562d0ad0eff7","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc","prepack":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"abd3lraouf","email":"abdelraoufsabri@gmail.com"},"prettier":{"semi":false,"proseWrap":"always","singleQuote":true},"repository":{"url":"git+https://github.com/abd3lraouf/vec2drawable.git","type":"git"},"_npmVersion":"11.9.0","description":"Convert SVG files to Android VectorDrawable XML — pure TypeScript, no JDK required","directories":{"lib":"dist","test":"tests"},"_nodeVersion":"25.6.1","dependencies":{"@xmldom/xmldom":"^0.8.12"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","prettier":"^3.8.1","typescript":"^5.9.3","@types/jest":"^29.5.14","@types/node":"^20.19.37"},"_npmOperationalInternal":{"tmp":"tmp/vec2drawable_1.0.0_1775158429877_0.6124250470267385","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@abd3lraouf/vec2drawable","version":"1.1.3","keywords":["android","vector","drawable","svg","vd-tool","vec2drawable","converter"],"author":{"name":"abd3lraouf","email":"https://github.com/abd3lraouf"},"license":"MIT","_id":"@abd3lraouf/vec2drawable@1.1.3","maintainers":[{"name":"abd3lraouf","email":"abdelraoufsabri@gmail.com"}],"homepage":"https://github.com/abd3lraouf/vec2drawable#readme","bugs":{"url":"https://github.com/abd3lraouf/vec2drawable/issues"},"bin":{"vec2drawable":"cli.js"},"dist":{"shasum":"b4a331697b29429dd804675b77190a724253d274","tarball":"https://registry.npmjs.org/@abd3lraouf/vec2drawable/-/vec2drawable-1.1.3.tgz","fileCount":23,"integrity":"sha512-iGY0FdbANXF6UtEwedgexGthBejXTn8S5z/vqOB8T/DvsYpxDWEu5Wf1lA15A2+ioFpk1DVV8uST7s1eLnUdxQ==","signatures":[{"sig":"MEUCIQD2fdNznwpAYniHUKXDqhL8MrIuYaEXKonISHulT797xgIgQAFsaVAb2XBi0hO0r2+5ztYamESrIxIqoYbUHjoWTwE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abd3lraouf%2fvec2drawable@1.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":68779},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"c59851ce1859e81da5855d9170c65bbc8dbc9b88","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc","prepack":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7e40dccd-3254-47c0-a8f6-5ff6e22d15cc"}},"prettier":{"semi":false,"proseWrap":"always","singleQuote":true},"repository":{"url":"git+https://github.com/abd3lraouf/vec2drawable.git","type":"git"},"_npmVersion":"11.9.0","description":"Convert SVG files to Android VectorDrawable XML — pure TypeScript, no JDK required","directories":{"lib":"dist","test":"tests"},"_nodeVersion":"24.14.0","dependencies":{"svgo":"^4.0.1","@xmldom/xmldom":"^0.8.12"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","prettier":"^3.8.1","typescript":"^5.9.3","@types/jest":"^29.5.14","@types/node":"^20.19.37","@types/svgo":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vec2drawable_1.1.3_1775161694793_0.23018125729746175","host":"s3://npm-registry-packages-npm-production"}},"1.1.4":{"name":"@abd3lraouf/vec2drawable","version":"1.1.4","description":"Convert SVG files to Android VectorDrawable XML — pure TypeScript, no JDK required","directories":{"lib":"dist","test":"tests"},"bin":{"vec2drawable":"cli.js"},"publishConfig":{"access":"public","provenance":true},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest","prepack":"tsc","prepublishOnly":"tsc"},"repository":{"type":"git","url":"git+https://github.com/abd3lraouf/vec2drawable.git"},"keywords":["android","vector","drawable","svg","vd-tool","vec2drawable","converter"],"author":{"name":"abd3lraouf","email":"https://github.com/abd3lraouf"},"license":"MIT","bugs":{"url":"https://github.com/abd3lraouf/vec2drawable/issues"},"homepage":"https://github.com/abd3lraouf/vec2drawable#readme","engines":{"node":">=18.0.0"},"prettier":{"singleQuote":true,"semi":false,"proseWrap":"always"},"devDependencies":{"@types/jest":"^29.5.14","@types/node":"^20.19.37","@types/svgo":"^3.0.0","jest":"^29.7.0","prettier":"^3.8.1","ts-jest":"^29.4.9","typescript":"^5.9.3"},"dependencies":{"@xmldom/xmldom":"^0.8.12","svgo":"^4.0.1"},"gitHead":"bdd1de1a1b0cd5aec497fa70b1c8e4ba68100de9","_id":"@abd3lraouf/vec2drawable@1.1.4","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-f/8Nu81FgRPsF1uHQ6eoBVkaY+tQmGPR+VSHUyUiRFDZVg6OJ4SbVGJSFYqihFC6EIlmVeQBvTs5G0wlxOH0Iw==","shasum":"ffcba2238570cc12bd77d03f2706bb592c3f2294","tarball":"https://registry.npmjs.org/@abd3lraouf/vec2drawable/-/vec2drawable-1.1.4.tgz","fileCount":23,"unpackedSize":68779,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abd3lraouf%2fvec2drawable@1.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKMGcDFsVWm2cc38sn7FG7+RJBrfYBfTlH6NoVdPJaBwIhANHFwvN31DvMiKoO8lokJIhmc/gbh/PJ7scIVWO4pNEk"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7e40dccd-3254-47c0-a8f6-5ff6e22d15cc"}},"maintainers":[{"name":"abd3lraouf","email":"abdelraoufsabri@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vec2drawable_1.1.4_1775162040002_0.2614715481880885"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-02T19:33:49.494Z","modified":"2026-04-02T20:34:00.440Z","1.0.0":"2026-04-02T19:33:50.127Z","1.1.3":"2026-04-02T20:28:14.953Z","1.1.4":"2026-04-02T20:34:00.155Z"},"bugs":{"url":"https://github.com/abd3lraouf/vec2drawable/issues"},"author":{"name":"abd3lraouf","email":"https://github.com/abd3lraouf"},"license":"MIT","homepage":"https://github.com/abd3lraouf/vec2drawable#readme","keywords":["android","vector","drawable","svg","vd-tool","vec2drawable","converter"],"repository":{"type":"git","url":"git+https://github.com/abd3lraouf/vec2drawable.git"},"description":"Convert SVG files to Android VectorDrawable XML — pure TypeScript, no JDK required","maintainers":[{"name":"abd3lraouf","email":"abdelraoufsabri@gmail.com"}],"readme":"# @abd3lraouf/vec2drawable\n\nA pure TypeScript, zero-dependency (JDK-free) command-line tool and Node.js library for converting SVG files into Android VectorDrawable XML files.\n\nThis is a modern rewrite of the original Android Studio VectorDrawable conversion tool, fully eliminating the need for a Java Runtime Environment.\n\n## Installation\n\nYou can install `vec2drawable` globally or add it as a dependency to your project. Supports `npm`, `pnpm`, and `bun`.\n\n### Using `bun` (Recommended)\n```bash\n# Global CLI\nbun add -g @abd3lraouf/vec2drawable\n\n# Project Dependency\nbun add @abd3lraouf/vec2drawable\n```\n\n### Using `pnpm`\n```bash\n# Global CLI\npnpm add -g @abd3lraouf/vec2drawable\n\n# Project Dependency\npnpm add @abd3lraouf/vec2drawable\n```\n\n### Using `npm`\n```bash\n# Global CLI\nnpm i -g @abd3lraouf/vec2drawable\n\n# Project Dependency\nnpm i @abd3lraouf/vec2drawable\n```\n\n## CLI Usage\n\n```bash\nvec2drawable [-c] [-d] [-in <file or directory>] [-out <directory>] [-widthDp <size>] [-heightDp <size>] [-addHeader]\n```\n\n### Options\n\n*   `-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. \n*   `-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.\n*   `-c`: Convert SVG files to VectorDrawable XML.\n*   `-d`: Display the results of the conversion in the terminal.\n*   `-widthDp <size>`: Force the width to be `<size>` dp, `<size>` must be an integer.\n*   `-heightDp <size>`: Force the height to be `<size>` dp, `<size>` must be an integer.\n*   `-addHeader`: Add the AOSP copyright header to the top of the generated XML file.\n\n### Examples\n\n**1. Convert a single SVG file:**\n```bash\nvec2drawable -c -in icon.svg\n```\n\n**2. Convert all SVG files in a directory to a specific output folder:**\n```bash\nvec2drawable -c -in ./svgs -out ./res/drawable\n```\n\n**3. Convert and display the XML output in the terminal:**\n```bash\nvec2drawable -c -d -in icon.svg\n```\n\n**4. Convert and resize:**\n```bash\nvec2drawable -c -in icon.svg -widthDp 24 -heightDp 24\n```\n\n## Node.js Library Usage\n\nYou can also use `vec2drawable` programmatically in your Node.js scripts.\n\n```typescript\nimport { vdConvert } from '@abd3lraouf/vec2drawable';\n\nasync function convertIcon() {\n  try {\n    const result = await vdConvert('path/to/icon.svg', {\n      outDir: 'path/to/output/dir', // Optional output directory\n      width: 24,                    // Optional forced width in DP\n      height: 24,                   // Optional forced height in DP\n      addHeader: true               // Optional AOSP header injection\n    });\n\n    console.log(`Successfully converted to ${result.output}`);\n    \n    // Warnings and errors from the conversion are captured here:\n    if (result.warnings) {\n      console.warn('Warnings:', result.warnings);\n    }\n  } catch (err) {\n    console.error('Conversion failed:', err);\n  }\n}\n\nconvertIcon();\n```\n\n## License\nMIT\n","readmeFilename":"README.md"}