{"_id":"@bung87/icon-gen","_rev":"1-cf21da805b6698fa6b606eab18e26e34","name":"@bung87/icon-gen","dist-tags":{"latest":"2.1.0"},"versions":{"2.1.0":{"name":"@bung87/icon-gen","description":"Generate an icon files from the SVG or PNG files","version":"2.1.0","author":{"name":"akabeko","url":"http://akabeko.me/"},"license":"MIT","homepage":"https://github.com/akabekobeko/npm-icon-gen#readme","engines":{"node":">= 10"},"publishConfig":{"access":"public"},"main":"dist/lib/index.js","bin":{"icon-gen":"dist/bin/index.js"},"keywords":["Icon","Generator","SVG","CLI"],"repository":{"type":"git","url":"git+https://github.com/akabekobeko/npm-icon-gen.git"},"bugs":{"url":"https://github.com/akabekobeko/npm-icon-gen/issues"},"scripts":{"test":"jest","start":"npm run watch","tsc":"tsc --noEmit","build":"tsc","watch":"tsc -w","prepare":"npm run build"},"dependencies":{"commander":"^6.2.0","del":"^6.0.0","import-cwd":"^3.0.0","mkdirp":"^1.0.4","pngjs":"^6.0.0","uuid":"^8.3.1"},"peerDependencies":{"svg2png":"4.1.1"},"devDependencies":{"@types/cross-spawn":"^6.0.2","@types/jest":"^26.0.16","@types/mkdirp":"^1.0.1","@types/node":"^14.14.10","@types/pngjs":"^3.4.2","@types/svg2png":"^4.1.0","@types/uuid":"^8.3.0","jest":"^26.6.3","svg2png":"^4.1.1","ts-jest":"^26.4.4","typescript":"^4.1.2"},"gitHead":"09b67839ffca6467aa1f52f3edeaa8b09eb07205","_id":"@bung87/icon-gen@2.1.0","_nodeVersion":"14.12.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nEdqE0TGjl1y/HlSJepNaDzUrWCwf5UOeJ/7oOGuNrwlTScIHvUhBFrWhFGO3Mfz4kK4/V/Xn8E4BNLrmCJaaQ==","shasum":"764c29dca4a13dd92fa0e9f1762cdccbf36a3ec1","tarball":"https://registry.npmjs.org/@bung87/icon-gen/-/icon-gen-2.1.0.tgz","fileCount":22,"unpackedSize":67105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEz9VCRA9TVsSAnZWagAAZrcP/3Y/oLikmc/Co3Gllh56\nAV4UGesZDeBpFPAtSCR92TJShA+RzAC0tZ4JCLctolAabnzbZkaD3K67bfiS\nLe5RBGQshoTGaXYZ41UHcc+8GsC9CFg/ZunG/qoVJ/4gKQK1UJV0lX+yRRBi\nAPl2xpcdvDIue/CD4BVtJq+uMD3uEdFzcVBtTaY2zuJY6msxD8CyNANSkJSD\nI23H46Ya9G1sLiLqz6b5lIq8p9nDNJyJcGWoPxcMXzR4PUG/IYV0obvBYIR6\n0H3w4sVttzDha+hk7Xu7tiaZeifU/WAVExeoObW+x9Pl89NkOUfAT2cJhoDh\nmbf2gFMEVvgUrT9brGSKbVFQ1QADdiW/HHHS7AmNX0pYnIsNkxPY0UbEn9O4\nWMUyyoO0kuMGmAZkP5UD5b5YcCnnBr9Gzlpk3GNzZSKb0+4MAtOpBoUA3l1m\nPxmcWtY2V9ytnA9mBg17eYzb0nUoCzvRArOzVsDFgkJLvElSnFFUWO0/CYtQ\nNar7eJNylbaORTQN9uW+1j9iZnZKeZBM1ABVsn3/XldLjoFayUQ5XLWRWkCE\nL0bIGq5OjO8vL6o/Bj+2wWeHxM5hxsw7WKaYOJFnWoiUpw6Mco2I51R9XWEg\nM8s7w4errfnw1A04POnR+zA2aKuVOImregZJxZQJy+CfQfuRiYT7hZuDuFYH\ncxi6\r\n=sPqQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEmc0GPY+zD/cFhgSLd9juNmUyr3IoEQ3mfRdflc8bVqAiB1LScSB2kUaQvTyujXJEUag7j85EAym7aIU7ruEwQrkQ=="}]},"_npmUser":{"name":"bung87","email":"crc32@qq.com"},"directories":{},"maintainers":[{"name":"bung87","email":"crc32@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/icon-gen_2.1.0_1611874132932_0.2428201118527138"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-28T22:48:52.894Z","2.1.0":"2021-01-28T22:48:53.047Z","modified":"2022-04-04T21:06:09.584Z"},"maintainers":[{"name":"bung87","email":"crc32@qq.com"}],"description":"Generate an icon files from the SVG or PNG files","homepage":"https://github.com/akabekobeko/npm-icon-gen#readme","keywords":["Icon","Generator","SVG","CLI"],"repository":{"type":"git","url":"git+https://github.com/akabekobeko/npm-icon-gen.git"},"author":{"name":"akabeko","url":"http://akabeko.me/"},"bugs":{"url":"https://github.com/akabekobeko/npm-icon-gen/issues"},"license":"MIT","readme":"# npm-icon-gen\n\n[![Support Node of LTS](https://img.shields.io/badge/node-LTS-brightgreen.svg)](https://nodejs.org/)\n[![npm version](https://badge.fury.io/js/icon-gen.svg)](https://badge.fury.io/js/icon-gen)\n[![Build Status](https://travis-ci.org/akabekobeko/npm-icon-gen.svg?branch=master)](https://travis-ci.org/akabekobeko/npm-icon-gen)\n\nGenerate an icon files from the **SVG** or **PNG** files.\n\n## Support formats\n\nSupported the output format of the icon are following.\n\n| Platform | Icon                                |\n| -------: | ----------------------------------- |\n|  Windows | `app.ico` or specified name.        |\n|    macOS | `app.icns` or specified name.       |\n|  Favicon | `favicon.ico` and `favicon-XX.png`. |\n\n## Installation\n\n```\n$ npm install icon-gen\n```\n\n## Usage\n\nSVG and PNG are automatically selected from the `input` path. If the path indicates a file **SVG**, if it is a directory it will be a **PNG** folder.\n\n### SVG\n\nSVG files are rendering to PNG file in **svg2png**. Rendering files is output to a temporary directory of the each OS.\n\nRendering of svg2png is run by [phantomjs](https://www.npmjs.com/package/phantomjs). Please use the PNG directory If the rendering quality there is a problem.\n\n```js\nconst icongen = require('icon-gen')\n\nicongen('./sample.svg', './icons', { report: true })\n  .then((results) => {\n    console.log(results)\n  })\n  .catch((err) => {\n    console.error(err)\n  })\n```\n\n### PNG\n\nGenerate an icon files from the directory of PNG files.\n\n```js\nconst icongen = require('icon-gen');\n\nicongen('./images', './icons', , { report: true })\n.then((results) => {\n  console.log(results);\n} )\n.catch((err) => {\n  console.error(err);\n});\n```\n\nRequired PNG files is below. Favicon outputs both the ICO and PNG files (see: [audreyr/favicon-cheat-sheet](https://github.com/audreyr/favicon-cheat-sheet)).\n\n|     Name |      Size |   ICO    |   ICNS   | Fav ICO  | Fav PNG  |\n| -------: | --------: | :------: | :------: | :------: | :------: |\n|   16.png |     16x16 | &#10004; | &#10004; | &#10004; |          |\n|   24.png |     24x24 | &#10004; |          | &#10004; |          |\n|   32.png |     32x32 | &#10004; | &#10004; | &#10004; | &#10004; |\n|   48.png |     48x48 | &#10004; |          | &#10004; |          |\n|   57.png |     57x57 |          |          |          | &#10004; |\n|   64.png |     64x64 | &#10004; | &#10004; | &#10004; |          |\n|   72.png |     72x72 |          |          |          | &#10004; |\n|   96.png |     96x96 |          |          |          | &#10004; |\n|  120.png |   120x120 |          |          |          | &#10004; |\n|  128.png |   128x128 | &#10004; | &#10004; |          | &#10004; |\n|  144.png |   144x144 |          |          |          | &#10004; |\n|  152.png |   152x152 |          |          |          | &#10004; |\n|  195.png |   195x195 |          |          |          | &#10004; |\n|  228.png |   228x228 |          |          |          | &#10004; |\n|  256.png |   256x256 | &#10004; | &#10004; |          |          |\n|  512.png |   512x512 |          | &#10004; |          |          |\n| 1024.png | 1024x1024 |          | &#10004; |          |          |\n\nTo make it a special size configuration, please specify with `ico`,`icns` and `favicon` options.\n\n## Node API\n\n### icongen\n\n**icongen** is promisify function.\n\n`icongen(src, dest[, options])`\n\n| Name    | Type     | Description                                                                  |\n| ------- | -------- | ---------------------------------------------------------------------------- |\n| src     | `String` | Path of the **SVG file** or **PNG files directory** that becomes the source. |\n| dest    | `String` | Destination directory path.                                                  |\n| options | `Object` | see: _Options_.                                                              |\n\n_Options:_\n\n```js\nconst options = {\n  report: true,\n  ico: {\n    name: 'app',\n    sizes: [16, 24, 32, 48, 64, 128, 256]\n  },\n  icns: {\n    name: 'app',\n    sizes: [16, 32, 64, 128, 256, 512, 1024]\n  },\n  favicon: {\n    name: 'favicon-',\n    pngSizes: [32, 57, 72, 96, 120, 128, 144, 152, 195, 228],\n    icoSizes: [16, 24, 32, 48, 64]\n  }\n}\n```\n\nIf all image options (`ico`,`icns`, `favicon`) are omitted, all images are output with their default settings.\n\n```js\n// Output an all images with default settings\nconst options = {\n  report: true\n}\n```\n\nIf individual image option is omitted, default setting is used. If there is a format that you do not want to output, specify others and omit that image.\n\n```js\n// Without ICNS\nconst options = {\n  report: true,\n  ico: {}\n  favicon: {}\n}\n```\n\n| Name    | Type      | Description                                                        |\n| ------- | --------- | ------------------------------------------------------------------ |\n| report  | `Boolean` | Display the process reports. Default is `false`, disable a report. |\n| ico     | `Object`  | Output setting of ICO file.                                        |\n| icns    | `Object`  | Output setting of ICNS file.                                       |\n| favicon | `Object`  | Output setting of Favicon file (PNG and ICO).                      |\n\n_`ico`, `icns`_\n\n| Name  | Type       | Default         | Description                  |\n| ----- | ---------- | --------------- | ---------------------------- |\n| name  | `String`   | `app`           | Name of an output file.      |\n| sizes | `Number[]` | `[Defaults...]` | Structure of an image sizes. |\n\n_`favicon`_\n\n| Name     | Type       | Default         | Description                                                                                                                                            |\n| -------- | ---------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| name     | `String`   | `favicon-`      | Prefix of an output PNG files. Start with the alphabet, can use `-` and `_`. This option is for PNG. The name of the ICO file is always `favicon.ico`. |\n| pngSizes | `Number[]` | `[Defaults...]` | Size structure of PNG files to output.                                                                                                                 |\n| icoSizes | `Number[]` | `[Defaults...]` | Structure of an image sizes for ICO.                                                                                                                   |\n\n## CLI\n\n```\nUsage:  icon-gen [options]\n\nGenerate an icon from the SVG or PNG file.\nIf \"--ico\", \"--icns\", \"--favicon\" is not specified, everything is output in the standard setting.\n\nOptions:\n  -i, --input <Path>           Path of the SVG file or PNG file directory.\n  -o, --output <Path>          Path of the output directory.\n  -r, --report                 Display the process reports, default is disable.\n  --ico                        Output ICO file with default settings, option is \"--ico-*\".\n  --ico-name <Name>            ICO file name to output.\n  --ico-sizes [Sizes]          PNG size list to structure ICO file\n  --icns                       Output ICNS file with default settings, option is \"--icns-*\".\n  --icns-name <Name>           ICO file name to output.\n  --icns-sizes [Sizes]         PNG size list to structure ICNS file\n  --favicon                    Output Favicon files with default settings, option is \"--favicon-*\".\n  --favicon-name <Name>        prefix of the PNG file. Start with the alphabet, can use \"-\" and \"_\"\n  --favicon-png-sizes [Sizes]  Sizes of the Favicon PNG files\n  --favicon-ico-sizes [Sizes]  PNG size list to structure Favicon ICO file\n  -v, --version                output the version number\n  -h, --help                   output usage information\n\nExamples:\n  $ icon-gen -i sample.svg -o ./dist -r\n  $ icon-gen -i ./images -o ./dist -r\n  $ icon-gen -i sample.svg -o ./dist --ico --icns\n  $ icon-gen -i sample.svg -o ./dist --ico --ico-name sample --ico-sizes 16,32\n  $ icon-gen -i sample.svg -o ./dist --icns --icns-name sample --icns-sizes 16,32\n  $ icon-gen -i sample.svg -o ./dist --favicon --favicon-name=favicon-  --favicon-png-sizes 16,32,128 --favicon-ico-sizes 16,32\n\nSee also:\n  https://github.com/akabekobeko/npm-icon-gen\n```\n\n# ChangeLog\n\n- [CHANGELOG](CHANGELOG.md)\n\n# License\n\n- [MIT](LICENSE.txt)\n","readmeFilename":"README.md"}