{"id":13619282,"url":"https://github.com/akabekobeko/npm-icon-gen","last_synced_at":"2025-05-16T08:06:44.176Z","repository":{"id":3568293,"uuid":"50175684","full_name":"akabekobeko/npm-icon-gen","owner":"akabekobeko","description":"Icon file generator for Windows, macOS, Web","archived":false,"fork":false,"pushed_at":"2024-07-16T10:49:10.000Z","size":1012,"stargazers_count":156,"open_issues_count":8,"forks_count":29,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T18:08:19.766Z","etag":null,"topics":["generator","icon","node","npm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akabekobeko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-22T10:51:44.000Z","updated_at":"2024-09-29T09:14:56.000Z","dependencies_parsed_at":"2024-11-21T04:01:59.880Z","dependency_job_id":null,"html_url":"https://github.com/akabekobeko/npm-icon-gen","commit_stats":{"total_commits":218,"total_committers":15,"mean_commits":"14.533333333333333","dds":"0.20642201834862384","last_synced_commit":"06e93c6572f19593ce810b8d3df4ee304446db35"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabekobeko%2Fnpm-icon-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabekobeko%2Fnpm-icon-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabekobeko%2Fnpm-icon-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabekobeko%2Fnpm-icon-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akabekobeko","download_url":"https://codeload.github.com/akabekobeko/npm-icon-gen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493379,"owners_count":22080127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","icon","node","npm"],"created_at":"2024-08-01T21:00:37.330Z","updated_at":"2025-05-16T08:06:39.164Z","avatar_url":"https://github.com/akabekobeko.png","language":"TypeScript","funding_links":[],"categories":["Development","npm"],"sub_categories":["Icons"],"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![test](https://github.com/akabekobeko/npm-icon-gen/workflows/test/badge.svg)\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 [sharp](https://www.npmjs.com/package/sharp). Rendering files is output to a temporary directory of the each OS.\n\n```js\nconst icongen = require('icon-gen')\n\nicongen('./sample.svg', './icons', { report: true })\n  .then((results) =\u003e {\n    console.log(results)\n  })\n  .catch((err) =\u003e {\n    console.error(err)\n  })\n```\n\nStopped using [svg2png](https://www.npmjs.com/package/svg2png) because of its dependency on [phantomjs](https://www.npmjs.com/package/phantomjs), which is deprecated.\n\nThe quality of PNG generated from SVG will change, so if you need the previous results, use `icon-gen v2.1.0` (old version).\n\n```\n$ npm install icon-gen@2.1.0\n```\n\nIn the future, I may add SVG to PNG conversion by Chromium via [puppeteer-core](https://www.npmjs.com/package/puppeteer-core) in addition to [sharp](https://www.npmjs.com/package/sharp).\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) =\u003e {\n    console.log(results)\n  })\n  .catch((err) =\u003e {\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 | \u0026#10004; | \u0026#10004; | \u0026#10004; |          |\n|   24.png |     24x24 | \u0026#10004; |          | \u0026#10004; |          |\n|   32.png |     32x32 | \u0026#10004; | \u0026#10004; | \u0026#10004; | \u0026#10004; |\n|   48.png |     48x48 | \u0026#10004; |          | \u0026#10004; |          |\n|   57.png |     57x57 |          |          |          | \u0026#10004; |\n|   64.png |     64x64 | \u0026#10004; | \u0026#10004; | \u0026#10004; |          |\n|   72.png |     72x72 |          |          |          | \u0026#10004; |\n|   96.png |     96x96 |          |          |          | \u0026#10004; |\n|  120.png |   120x120 |          |          |          | \u0026#10004; |\n|  128.png |   128x128 | \u0026#10004; | \u0026#10004; |          | \u0026#10004; |\n|  144.png |   144x144 |          |          |          | \u0026#10004; |\n|  152.png |   152x152 |          |          |          | \u0026#10004; |\n|  195.png |   195x195 |          |          |          | \u0026#10004; |\n|  228.png |   228x228 |          |          |          | \u0026#10004; |\n|  256.png |   256x256 | \u0026#10004; | \u0026#10004; |          |          |\n|  512.png |   512x512 |          | \u0026#10004; |          |          |\n| 1024.png | 1024x1024 |          | \u0026#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 \u003cPath\u003e           Path of the SVG file or PNG file directory.\n  -o, --output \u003cPath\u003e          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 \u003cName\u003e            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 \u003cName\u003e           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 \u003cName\u003e        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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakabekobeko%2Fnpm-icon-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakabekobeko%2Fnpm-icon-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakabekobeko%2Fnpm-icon-gen/lists"}