vscode-icons-svg

Get the icon url in SVG given the file extension.

Usage no npm install needed!

<script type="module">
  import vscodeIconsSvg from 'https://cdn.skypack.dev/vscode-icons-svg';
</script>

README

VSCode Icons SVG

Get the icon url in SVG given the file extension.

Demo

https://vscode-icons-svg.netlify.app

demo

Install

https://www.jsdelivr.com/package/gh/giovanigenerali/vscode-icons-svg

<script src="https://cdn.jsdelivr.net/gh/giovanigenerali/vscode-icons-svg@2.0.0/dist/vscode-icons-svg.min.js"></script>

How to use

vscodeIconsSVG.get("file.jsx");

// https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_reactjs.svg
const icon = document.createElement("IMG");
icon.src = vscodeIconsSVG.get("file.jsx");
icon.alt = "Icon file.jsx";
icon.loading = "lazy";
icon.setAttribute("style", "width: 100px; height: 100px;");

document.body.appendChild(icon);

Dependency

Author