{"_id":"@akabeko/svg2png","_rev":"2-6362d7552ad67a16ff1944c52e268034","name":"@akabeko/svg2png","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@akabeko/svg2png","description":"Create PNG file from SVG file with puppeteer-core","version":"1.0.0","author":{"name":"akabeko","url":"https://akabeko.me/"},"license":"MIT","homepage":"https://github.com/akabekobeko/npm-svg2png#readme","engines":{"node":">= 12"},"publishConfig":{"access":"public"},"main":"dist/lib/index.js","bin":{"svg2png":"dist/bin/index.js"},"keywords":["SVG","PNG"],"repository":{"type":"git","url":"git+https://github.com/akabekobeko/npm-svg2png.git"},"bugs":{"url":"https://github.com/akabekobeko/npm-svg2png/issues"},"scripts":{"test":"jest","start":"npm run watch","tsc":"tsc --noEmit","build":"tsc","watch":"tsc -w","prepare":"npm run build"},"dependencies":{"commander":"^6.0.0","puppeteer-core":"^5.2.1","upath":"^1.2.0"},"devDependencies":{"@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/puppeteer-core":"^2.0.0","jest":"^26.4.2","ts-jest":"^26.2.0","typescript":"^4.0.2"},"gitHead":"b78fdc981537c160bf9c546e0563fde49295dfa8","_id":"@akabeko/svg2png@1.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-In4be31smBbHaMZK/o7yasevHOmeq6znPiBYK1dS8Z5PV8jS60feff9/yxcEm9Dp9yt70FpwHBkHInsZ2Nnpjw==","shasum":"33cb0e1f37e4eac7604c123cf72db5f3d64159da","tarball":"https://registry.npmjs.org/@akabeko/svg2png/-/svg2png-1.0.0.tgz","fileCount":14,"unpackedSize":21095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRiiWCRA9TVsSAnZWagAAw0kQAIm9Uqi2LaY6Se3dtGqT\n++IkfLYx/7TSJ1Q4QeZqLRAUDHmafza/3Nj8H4idD6oBiiF+uJdxDfPXC7l7\nkJ58A0fXi1VZ5vPInpACyWwAwmhKx3Q4KG/+KnDfgHZ4gR42Mz6Ld9ucNevN\nI91eR53Ci3r5JJHAvYY4DdV8lFGY8ZdPjYVwGJ+gq19mKfghkWHzSjI8xGzX\nWYymVq5sj1Ht2MwoBPqNyP2/qyRyNtOVhH9NtgPlDvH9TspwJxAiw/nrI6z8\n5WkbYvSxZSNIjzgdQ2Eq2faB3+pHbhM+pAAv726FS7+1I6//Dooa9IWfEGJB\nxzObOn+0jl3/Pwd36aBuwv7I/EpwJKDMmGJvJOQeFlTXO276RJGlLVNa1TEn\nRvDRkzIf/dZY2IoYuuF7XnQEL7kxI8Na2MCoo9cq/wAYeCO6fautt0UrJGGu\noh3VE/eDHSrsXY8J0AfzSdxkmy3s6cfnfG7rGEExZZCUhVh4UE1E1sqdR0d/\nDFwMVB2LoWfLy+hc9NOT8jEaMeI/88qjoRy360ynDqVdW7hpv6H5nQseXCBR\ndjvwtqdvQQKdFos4IV6CFSCC/KwMcy2mIeyS7R8Ke++zMRD0NjvDIKO7GnyL\nbpDnmT3Kvh9S8i/hMQpdeBvSsgqCBWASvD+MeS1XWji3YnCtNBDosMapJFIa\nRpNw\r\n=bEQY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrNm0KfOVl0addW52b4CgwBJ9TXIXiJmIGwYiEhl9/fgIhAJAomf+CSy8djnJL8/8GgFFZKyHP5Mku/swluTBR2D5R"}]},"maintainers":[{"name":"akabeko","email":"akabekobeko@gmail.com"}],"_npmUser":{"name":"akabeko","email":"akabekobeko@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/svg2png_1.0.0_1598433429937_0.09989390403270715"},"_hasShrinkwrap":false},"1.0.1":{"name":"@akabeko/svg2png","description":"Create PNG file from SVG file with puppeteer-core","version":"1.0.1","author":{"name":"akabeko","url":"https://akabeko.me/"},"license":"MIT","homepage":"https://github.com/akabekobeko/npm-svg2png#readme","engines":{"node":">= 12"},"publishConfig":{"access":"public"},"main":"dist/lib/index.js","bin":{"svg2png":"dist/bin/index.js"},"keywords":["SVG","PNG"],"repository":{"type":"git","url":"git+https://github.com/akabekobeko/npm-svg2png.git"},"bugs":{"url":"https://github.com/akabekobeko/npm-svg2png/issues"},"scripts":{"test":"jest","start":"npm run watch","tsc":"tsc --noEmit","build":"tsc","watch":"tsc -w","prepare":"npm run build"},"dependencies":{"commander":"^6.1.0","puppeteer-core":"^5.2.1","upath":"^1.2.0"},"devDependencies":{"@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/puppeteer-core":"^2.0.0","jest":"^26.4.2","ts-jest":"^26.3.0","typescript":"^4.0.2"},"gitHead":"fbc7ae394ad26fb220b53c92e137a4cf307457be","_id":"@akabeko/svg2png@1.0.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dJk8aUphYUTqIC3DbrhO/H6IG/ftDgT0wmRcSm4wTitlyqVHCYRVAVH4Li5IOkpTybgKQgLPHvmPl8QDWry8dw==","shasum":"c67b63cc6a83c9722b7d428969fb0bf315070faa","tarball":"https://registry.npmjs.org/@akabeko/svg2png/-/svg2png-1.0.1.tgz","fileCount":14,"unpackedSize":22088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSgibCRA9TVsSAnZWagAAAh0P/0bz7Z8ZdSoiPap0T3sL\nUTGafHMOHtVrH0a5lV+J0jfCDJfCx3GXI4iVQnHxNP+6X7LlegdlS9F060wU\nxv2AIUTEarygx2yUkqPQI1+QiOIsk05joJDa/MB9GkOsRej90LryS+vOEBhN\ntsfodszFEx9jfpFIUtNR2kY1CO4A5ewg9w2RGuDTSki720dZPV4Yg+yWGluM\n8dTIQoVjmisnA1r/VVSgQFUoKSi1BcgjVukgTl8Gy0EdHgr34gyAz8l+X5mM\nb32IcoGz8ib9wXvAMfPxnfvTE7NZfS7JQKOi6vz5C0Y+58yG85rFZxe8jJPA\nth2Jdep7qlV5e1O0kG4Fz0GQsFI16xLPoxkqPQchsbRKTkhKZ+DuCqz3jh13\nCIXkvh9l+OyNMLNHog/FZVCTyKBLdOtstlZ8o21z49OIDas467EWwH/NFpOl\nSoAwRQCWm1o8rQjelFfG1yyA2+VGYO8V4hYqwXS9uPXk8kkEb0OvFZNRnz0H\nFsc/at1WjXB0ArsIQWgs8VDBXA/CuJAOIrPSMtBLiAt1igZjgNI2ABQCtspU\nPpbuHZNUKUeg7DYpT29E+XwfV1bvpvk0qmwJoX/6TtbJrpKq4E08xXXmkBnb\nmgDqQTrRmmRJGRJ/pRsOiMp0r2Ie6LKENWI1zNCy0maa7kQxLRMkOUwPjwoo\niTEt\r\n=VIz8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJyP3vlFH/yJWncZ45OjnM0koLnFd09svrlfYowyC+igIhAO/ccoFMAyo8ygz23yB2vrJ9q3H2l6oXwoavAvSeAp/v"}]},"maintainers":[{"name":"akabeko","email":"akabekobeko@gmail.com"}],"_npmUser":{"name":"akabeko","email":"akabekobeko@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/svg2png_1.0.1_1598687387279_0.9702764783418449"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-26T09:17:09.885Z","1.0.0":"2020-08-26T09:17:10.047Z","modified":"2022-04-04T12:27:30.259Z","1.0.1":"2020-08-29T07:49:47.432Z"},"maintainers":[{"name":"akabeko","email":"akabekobeko@gmail.com"}],"description":"Create PNG file from SVG file with puppeteer-core","homepage":"https://github.com/akabekobeko/npm-svg2png#readme","keywords":["SVG","PNG"],"repository":{"type":"git","url":"git+https://github.com/akabekobeko/npm-svg2png.git"},"author":{"name":"akabeko","url":"https://akabeko.me/"},"bugs":{"url":"https://github.com/akabekobeko/npm-svg2png/issues"},"license":"MIT","readme":"# svg2png\n\n[![npm version](https://badge.fury.io/js/%40akabeko%2Fsvg2png.svg)](https://badge.fury.io/js/%40akabeko%2Fsvg2png)\n[![Build Status](https://travis-ci.org/akabekobeko/npm-svg2png.svg?branch=master)](https://travis-ci.org/akabekobeko/npm-svg2png)\n[![license: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akabekobeko/npm-svg2png/blob/master/LICENSE)\n\nCreate PNG file from SVG file with [puppeteer-core](https://www.npmjs.com/package/puppeteer-core). Use the specified revision or installed Chromium for PNG file creation.\n\n## Installation\n\n```\n$ npm install @akabeko/svg2png\n```\n\n## Node.js API\n\n### `svg2png(options: SVG2PNGOptions): Promise<string[]>`\n\nCreate the PNG file from the SVG file.\n\n- **options**: `SVG2PNGOptions` Options.\n  - **input**: `String` Path of the input SVG file.\n  - **output**: `String` Path of the output PNG file.\n  - **sizes**: `Size[]` Sizes of the output PNG files.\n    - **width**: `Number` Width (px).\n    - **height**: `Number` Height (px).\n  - **executablePath**: `String (Optional)` If use Chromium installed, specify the path of the executable file. If this is specified, `fetcher` will be ignored.\n  - **fetcher**: `Object` Information for downloading and using Chromium.\n    - **revision**: `String` Revision of the download Chromium. see: http://omahaproxy.appspot.com/\n    - **path**: `String` Path of the directory to download. If not specified, it will be selected in the puppeteer-core directory of `node_moduels`.\n\n**Returns**: `Promise<string[]>` Path collection of the output PNG files.\n\nIf there is a single `sizes` element, it will be output with the file name specified in `output`.\n\nWhen multiple sizes are specified, the size is specified in prefix like `sample-256.png`. If there are multiple sizes and the width and heigth are different, it becomes like `sample-24x32.png`.\n\nElements of `sizes` with `width` or `height` less than or equal to `0` are ignored. Also, if elements with the same `width`/`height` are duplicated (e.g. `[[24, 24], [24, 24]]` to `[[24, 24]]`), only one of them will be processed.\n\n```js\nimport { svg2png } from '@akabeko/svg2png'\n\n// Fetch Chromium\nsvg2png({\n  input: './sample.svg',\n  output: './sample.png',\n  sizes: [{ width: 256, height: 256 }],\n  fetcher: {\n    revision: '782078',\n    path: './renderer'\n  }\n})\n  .then((results) => {\n    console.log(results)\n    console.log('Completed!!!')\n  })\n  .catch((err) => {\n    console.log(err)\n  })\n\n// Use installed Chrome (Chromium) on macOS and multiple sizes\nsvg2png({\n  input: './sample.svg',\n  output: './sample.png',\n  sizes: [\n    { width: 256, height: 256 },\n    { width: 48, height: 64 }\n  ],\n  executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'\n})\n  .then((results) => {\n    console.log(results)\n    console.log('Completed!!!')\n  })\n  .catch((err) => {\n    console.log(err)\n  })\n```\n\n## CLI\n\n```\nUsage:  svg2png [options]\n\nCreate PNG file from SVG file with puppeteer-core. Use the specified revision or installed Chromium for PNG file creation.\n\nOptions:\n  -i, --input <String>         Path of the input SVG file. (default: \"\")\n  -o, --output <String>        Path of the output PNG file. (default: \"\")\n  --sizes <Size[]>             Sizes array of the output PNG file. Specify one element for the array if it is a square, and specify [width,height]\n                               for a rectangle. e.g. [256,[256,128],...]\n  --executable-path <String>   If use Chromium installed, specify the path of the executable file. If this is specified, `--fetcher-*` will be\n                               ignored. (default: \"\")\n  --fetcher-revision <String>  Revision of the download Chromium. see: http://omahaproxy.appspot.com/ (default: \"\")\n  --fetcher-path <String>      Path of the directory to download. If not specified, it will be selected in the puppeteer-core directory of\n                               `node_moduels`. (default: \"\")\n  -v, --version                output the version number\n  -h, --help                   display help for command\n\nExamples:\n  $ svg2png -i sample.svg -o sample.png --sizes [256] --executable-path \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\n  $ svg2png -i sample.svg -o sample.png --sizes [[24,32],256] --executable-path \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\Chrome.exe\"\n  $ svg2png -i sample.svg -o sample.png --sizes [256] --fetcher-revision 782078 --fetcher-path ./renderer\n\nSee also:\n  https://github.com/akabekobeko/npm-svg2png\n```\n","readmeFilename":"README.md"}