{"_id":"vscode-material-icons","_rev":"1-2863332877be855082f47c41c068fe5f","name":"vscode-material-icons","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"vscode-material-icons","version":"0.1.0","license":"MIT","description":"VSCode Material Icons wrapper for applications","keywords":["icons","material-icons","file-icons","folder-icons","vscode"],"author":{"name":"Matěj Chalk","email":"matejchalk@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/matejchalk/vscode-material-icons.git"},"homepage":"https://github.com/matejchalk/vscode-material-icons#readme","bugs":{"url":"https://github.com/matejchalk/vscode-material-icons/issues"},"type":"module","types":"dist/index.d.ts","main":"dist/index.cjs","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"scripts":{"prepublishOnly":"npm run build","build":"tsup","test":"vitest run","test:watch":"vitest watch","fetch-icons":"node scripts/fetch-icons.js","release":"release-it"},"devDependencies":{"@types/fs-extra":"^11.0.4","fs-extra":"^11.2.0","release-it":"^17.0.3","simple-git":"^3.22.0","tsup":"^8.0.2","typescript":"^5.3.3","vitest":"^1.2.2"},"gitHead":"d80dc0ef53d408b0f1aa295cefdb9b2c2fa6de97","_id":"vscode-material-icons@0.1.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-/fO1x+6JTg6QMB4W8VsIY5vwJEe/vELIg49yGIV2NLDrmLRr2nuyGo/IMMngkxu/ol4s8uQhwHFHTpdoyP6U5g==","shasum":"2e1f9dbacc59e99457f1ceb0da09670e63a1bd4c","tarball":"https://registry.npmjs.org/vscode-material-icons/-/vscode-material-icons-0.1.0.tgz","fileCount":896,"unpackedSize":1926564,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRn4j4z9m784S7oCrA2lakat5w9kckJx/Sbvsd+vLbhQIgWMNO+FegEzgT/ERYjH2BW9pU5qqHXaX6jGFIBWA55rQ="}]},"_npmUser":{"name":"matejchalk","email":"matej.chalk@flowup.cz"},"directories":{},"maintainers":[{"name":"matejchalk","email":"matej.chalk@flowup.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vscode-material-icons_0.1.0_1707570206280_0.44288236464349007"},"_hasShrinkwrap":false},"0.1.1":{"name":"vscode-material-icons","version":"0.1.1","license":"MIT","description":"VSCode Material Icons wrapper for applications","keywords":["icons","material-icons","file-icons","folder-icons","vscode"],"author":{"name":"Matěj Chalk","email":"matejchalk@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/matejchalk/vscode-material-icons.git"},"homepage":"https://github.com/matejchalk/vscode-material-icons#readme","bugs":{"url":"https://github.com/matejchalk/vscode-material-icons/issues"},"type":"module","types":"dist/index.d.ts","main":"dist/index.cjs","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"scripts":{"prepublishOnly":"npm run build","build":"tsup","test":"vitest run","test:watch":"vitest watch","fetch-icons":"node scripts/fetch-icons.js","release":"release-it","app:serve":"tsx watch --clear-screen=false src/app/main.ts","app:build":"tsup --config tsup.config.app.ts","app:run":"node dist-app/main.js"},"devDependencies":{"@types/express":"^4.17.21","@types/fs-extra":"^11.0.4","express":"^4.18.2","express-handlebars":"^7.1.2","fs-extra":"^11.2.0","match-sorter":"^6.3.4","release-it":"^17.0.3","simple-git":"^3.22.0","tsup":"^8.0.2","tsx":"^4.7.1","typescript":"^5.3.3","vitest":"^1.2.2"},"_id":"vscode-material-icons@0.1.1","gitHead":"acd4ad2a70669b11c7ff554627e1a6579de54b8e","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-GsoEEF8Tbb0yUFQ6N6FPvh11kFkL9F95x0FkKlbbfRQN9eFms67h+L3t6b9cUv58dSn2gu8kEhNfoESVCrz4ag==","shasum":"8404940692c071df49d575a76ef7bdf1f6541832","tarball":"https://registry.npmjs.org/vscode-material-icons/-/vscode-material-icons-0.1.1.tgz","fileCount":918,"unpackedSize":2610608,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJC+7YpohVIKg/QLTSHvCU6DXmjFGr4kwcacVGYestRAiEA8W0F5soGQ+sGk0lf2oOAiyunmdyGGKfKe3Er68WI3hA="}]},"_npmUser":{"name":"matejchalk","email":"matej.chalk@flowup.cz"},"directories":{},"maintainers":[{"name":"matejchalk","email":"matej.chalk@flowup.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vscode-material-icons_0.1.1_1714404589381_0.6978696268248286"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-10T13:03:26.279Z","0.1.0":"2024-02-10T13:03:26.571Z","modified":"2024-04-29T15:29:49.822Z","0.1.1":"2024-04-29T15:29:49.658Z"},"maintainers":[{"name":"matejchalk","email":"matej.chalk@flowup.cz"}],"description":"VSCode Material Icons wrapper for applications","homepage":"https://github.com/matejchalk/vscode-material-icons#readme","keywords":["icons","material-icons","file-icons","folder-icons","vscode"],"repository":{"type":"git","url":"git+ssh://git@github.com/matejchalk/vscode-material-icons.git"},"author":{"name":"Matěj Chalk","email":"matejchalk@gmail.com"},"bugs":{"url":"https://github.com/matejchalk/vscode-material-icons/issues"},"license":"MIT","readme":"# vscode-material-icons\n\n**[VSCode Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) wrapper for applications to self-host icons and select icon based on file path.**\n\nFor a full list of available icons, see [showcase](https://vscodematerialicons-byr3l7cm.b4a.run/).\n\n## Setup\n\nInstall `vscode-material-icons` with your package manager:\n\n<details>\n<summary>NPM</summary>\n\n```sh\nnpm install vscode-material-icons\n```\n\n</details>\n\n<details>\n<summary>Yarn</summary>\n\n```sh\nyarn add vscode-material-icons\n```\n\n</details>\n\n<details>\n<summary>PNPM</summary>\n\n```sh\npnpm add vscode-material-icons\n```\n\n</details>\n\n### Self-hosting icons\n\nIf you want to self-host the icons in your front-end app, configure your bundler to copy the `node_modules/vscode-material-icons/generated/icons` folder to your build output.\n\n<details>\n<summary>Webpack example</summary>\n\nUse [copy-webpack-plugin](https://webpack.js.org/plugins/copy-webpack-plugin/) in `webpack.config.js`:\n\n```js\nconst CopyPlugin = require('copy-webpack-plugin');\n\nmodule.exports = {\n  // ...\n  plugins: [\n    // ...\n    new CopyPlugin({\n      patterns: [\n        {\n          from: 'node_modules/vscode-material-icons/generated/icons',\n          to: 'assets/material-icons',\n        },\n      ],\n    }),\n  ],\n};\n```\n\n</details>\n\n<details>\n<summary>Angular example</summary>\n\nAppend to `assets` in `angular.json` (or `project.json` if using Nx):\n\n```jsonc\n{\n  // ..\n  \"targets\": {\n    \"build\": {\n      \"executor\": \"@angular-devkit/build-angular:browser\",\n      \"options\": {\n        // ...\n        \"assets\": [\n          // ...\n          {\n            \"glob\": \"**/*\",\n            \"input\": \"./node_modules/vscode-material-icons/generated/icons\",\n            \"output\": \"/assets/material-icons/\"\n          }\n        ]\n      }\n      // ...\n    }\n  }\n}\n```\n\n</details>\n\n## Usage\n\nUse exported functions to get an icon name/URL from a file/folder path:\n\n```ts\nimport {\n  getIconForFilePath,\n  getIconUrlByName,\n  getIconUrlForFilePath,\n  type MaterialIcon,\n} from 'vscode-material-icons';\n\n// should match output path configured in bundler\nconst ICONS_URL = '/assets/material-icons';\n\n// example 1: file path -> image URL\nconst iconUrl: string = getIconUrlForFilePath('src/index.html', ICONS_URL);\n\n// example 2: file path -> icon name\nconst icon: MaterialIcon = getIconForFilePath('src/app/app.component.ts');\n\n// example 3: icon name -> image URL\nconst tsIconUrl: string = getIconUrlByName('typescript', ICONS_URL);\n```\n\nIt's also simple to validate icon names in a type-safe way:\n\n```ts\nimport {\n  isMaterialIcon,\n  MATERIAL_ICONS,\n  type MaterialIcon,\n} from 'vscode-material-icons';\n\n// example 1: use union type for autocomplete\nlet icon: MaterialIcon;\n\n// example 2: validate icon name with type predicate function\nif (isMaterialIcon(value)) {\n  icon = value;\n}\n\n// example 3: integrate with schema validation library, e.g. Zod\nconst materialIconSchema = z.enum(MATERIAL_ICONS);\nicon = materialIconSchema.parse(value);\n```\n\n## Contributing\n\n- Install dependencies with `npm install`.\n- Run unit tests with `npm test`.\n- Build library with `npm run build`.\n- Re-fetch icons from VSCode extension with `npm run fetch-icons`.\n- Release new version with `npm run release`.\n","readmeFilename":"README.md"}