{"id":21436802,"url":"https://github.com/mtojo/node-system-icon","last_synced_at":"2025-07-14T14:33:24.041Z","repository":{"id":65513604,"uuid":"111540489","full_name":"mtojo/node-system-icon","owner":"mtojo","description":"Get associated file/folder icon for Node.js","archived":false,"fork":false,"pushed_at":"2020-10-09T19:58:53.000Z","size":11,"stargazers_count":20,"open_issues_count":4,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T17:36:38.660Z","etag":null,"topics":["file","icon","mac","macos","nodejs","windows"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtojo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T11:32:45.000Z","updated_at":"2024-07-17T14:42:28.000Z","dependencies_parsed_at":"2023-01-26T20:45:16.784Z","dependency_job_id":null,"html_url":"https://github.com/mtojo/node-system-icon","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Fnode-system-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Fnode-system-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Fnode-system-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Fnode-system-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtojo","download_url":"https://codeload.github.com/mtojo/node-system-icon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225981808,"owners_count":17554923,"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":["file","icon","mac","macos","nodejs","windows"],"created_at":"2024-11-23T00:15:50.972Z","updated_at":"2024-11-23T00:15:51.600Z","avatar_url":"https://github.com/mtojo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# system-icon\n\nGet associated file/folder icon for Node.js.\n\n## Installation\n\n```bash\n$ npm install --save system-icon\n```\n\n## Supported platforms\n\n* macOS 10.6 or later\n* Windows Vista or later\n\n## Usage\n\nGet icon for file or folder path:\n\n```js\nconst {writeFileSync} = require('fs');\nconst {\n  getIconForPath,\n  ICON_SIZE_MEDIUM\n} = require('system-icon');\n\ngetIconForPath(\"/path/to/file_or_folder\", ICON_SIZE_MEDIUM, (err, result) =\u003e {\n  if (err) {\n    console.error(err);\n  } else {\n    writeFileSync(\"icon.png\", result);\n  }\n});\n```\n\nGet icon for file extension:\n\n```js\nconst {writeFileSync} = require('fs');\nconst {\n  getIconForExtension,\n  ICON_SIZE_MEDIUM\n} = require('system-icon');\n\ngetIconForExtension(\".ext\", ICON_SIZE_MEDIUM, (err, result) =\u003e {\n  if (err) {\n    console.error(err);\n  } else {\n    writeFileSync(\"icon.png\", result);\n  }\n});\n```\n\n## API\n\n### Constants\n\n#### Size constants\n\nThe correspondence between the size constants and the icon size actually obtainable on each platform is as follows:\n\n| Constant                | Windows | macOS   |\n| ----------------------- | ------- | ------- |\n| `ICON_SIZE_EXTRA_SMALL` |  16x16  |  16x16  |\n| `ICON_SIZE_SMALL`       |  32x32  |  32x32  |\n| `ICON_SIZE_MEDIUM`      |  64x64  |  64x64  |\n| `ICON_SIZE_LARGE`       | 256x256 | 256x256 |\n| `ICON_SIZE_EXTRA_LARGE` | 256x256 | 512x512 |\n\n### Functions\n\n#### getIconForPath(path, size, callback)\n\nGets associated icon for file or folder path, and returns it in the PNG format.\n\n#### getIconForExtension(extension, size, callback)\n\nGets associated icon for file extension, and returns it in the PNG format.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtojo%2Fnode-system-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtojo%2Fnode-system-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtojo%2Fnode-system-icon/lists"}