
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Give an icon to a web resource file by Content-Type
or url
subfix.
npm install mime-icons
First, MUST copy icons
folder to your project's public files path.
Now, import module, with getIconName
function, you will get the target icon name. The function get 2 optional parameters:
parameter | from |
---|---|
contentType | HTTP response header's Content-Type |
url | resource url |
example:
import mime from "mime-icons";
const icon = mime.getIconName({
contentType: "text/html",
url: "http://xxx.com/index.html",
});
const imagePath = env.PUBLIC_PATH + "/icons/" + icon;
git clone https://github.com/DeronW/mime-icons
cd mime-icons/demo
npm i
npm run dev
# open http://localhost:5173
Thanks to apache for content-type and file extensions mapping, and vscode-icons for extensions icons.
customize
Some files has common extension, use common use case overwrite it, such as js
, css
, html
and soon.
FAQs
Pick an icon for specific media resource by MIME
The npm package mime-icons receives a total of 0 weekly downloads. As such, mime-icons popularity was classified as not popular.
We found that mime-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.