{"id":20226483,"url":"https://github.com/fiahfy/ico","last_synced_at":"2025-04-10T17:07:41.926Z","repository":{"id":38326036,"uuid":"151934351","full_name":"fiahfy/ico","owner":"fiahfy","description":"ICO file format parser and builder.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:58:14.000Z","size":1209,"stargazers_count":3,"open_issues_count":11,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T06:59:28.802Z","etag":null,"topics":["builder","ico","parser"],"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/fiahfy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-07T11:29:52.000Z","updated_at":"2022-05-04T15:32:32.000Z","dependencies_parsed_at":"2023-02-05T02:16:57.152Z","dependency_job_id":null,"html_url":"https://github.com/fiahfy/ico","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiahfy%2Fico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fiahfy","download_url":"https://codeload.github.com/fiahfy/ico/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224175776,"owners_count":17268389,"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":["builder","ico","parser"],"created_at":"2024-11-14T07:18:33.034Z","updated_at":"2024-11-14T07:18:33.706Z","avatar_url":"https://github.com/fiahfy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD024 --\u003e\n\n# ico\n\n![badge](https://github.com/fiahfy/ico/workflows/Node.js%20Package/badge.svg)\n\n\u003e [ICO file format](\u003chttps://en.wikipedia.org/wiki/ICO_(file_format)\u003e) parser and builder.\n\n## Installation\n\n```bash\nnpm install @fiahfy/ico\n```\n\n## Usage\n\n### Parsing\n\n```js\nimport fs from 'fs'\nimport { Ico } from '@fiahfy/ico'\n\nconst buf = fs.readFileSync('icon.ico')\nconst ico = Ico.from(buf)\nconsole.log(ico.fileHeader) // IcoFileHeader { reserved: 0, type: 1, count: 7 }\nconsole.log(ico.infoHeaders[0]) // IcoInfoHeader { width: 16, height: 16, ... }\n```\n\n### Building\n\n```js\nimport fs from 'fs'\nimport { Ico, IcoImage } from '@fiahfy/ico'\n\nconst ico = new Ico()\nlet buf\n\nbuf = fs.readFileSync('128x128.png')\nimage = IcoImage.fromPNG(buf)\nico.append(image)\n\nbuf = fs.readFileSync('256x256.png')\nimage = IcoImage.fromPNG(buf)\nico.append(image)\n\n/* Some other PNG files */\n\nfs.writeFileSync('icon.ico', ico.data)\n```\n\n## API\n\n### Class: Ico\n\n#### static from(buffer)\n\nCreate ICO from the icon buffer.\n\n##### buffer\n\nType: `Buffer`\n\nThe ICO icon buffer.\n\n#### append(image)\n\nAdds ICO image at the end.\n\n##### image\n\nType: `IcoImage`\n\nThe ICO Image to append.\n\n#### insert(image, index)\n\nInserts ICO image at the specified position.\n\n##### image\n\nType: `IcoImage`\n\nThe ICO Image to insert.\n\n##### index\n\nType: `number`\n\nThe position at which to insert the ICO Image.\n\n#### remove(index)\n\nRemoves ICO image at the specified position.\n\n##### index\n\nType: `number`\n\nThe position of the ICO Image to remove.\n\n#### fileHeader\n\nType: `IcoFileHeader`\n\nReturn the file header on the ICO.\n\n#### infoHeaders\n\nType: `IcoInfoHeader[]`\n\nReturn the ICO info header on the ICO.\n\n#### images\n\nType: `IcoImage[]`\n\nReturn the ICO images on the ICO.\n\n#### data\n\nType: `Buffer`\n\nReturn the ICO buffer.\n\n### Class: IcoImage\n\n#### static from(buffer)\n\nCreate ICO image from the buffer.\n\n##### buffer\n\nType: `Buffer`\n\nThe ICO image buffer.\n\n#### static fromPNG(buffer)\n\nCreate ICO Image from the PNG image buffer.\n\n##### buffer\n\nType: `Buffer`\n\nThe PNG image buffer.\n\n### Class: IcoInfoHeader\n\n#### static from(buffer)\n\nCreate ICO info header from the buffer.\n\n##### buffer\n\nType: `Buffer`\n\nThe ICO info header buffer.\n\n### Class: IcoFileHeader\n\n#### static from(buffer)\n\nCreate ICO file header from the buffer.\n\n##### buffer\n\nType: `Buffer`\n\nThe ICO file header buffer.\n\n## Specifications\n\n### Supported Size\n\n| Size    |\n| ------- |\n| 16x16   |\n| 24x24   |\n| 32x32   |\n| 48x48   |\n| 64x64   |\n| 128x128 |\n| 256x256 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiahfy%2Fico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiahfy%2Fico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiahfy%2Fico/lists"}