
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Image type Hint.
require! <[imgtype]> # only if use in nodejs imgtype(obj).then ({ext, mime}) -> ... # ext = null if can't figure it out
You can use imgtype.mime["..."]
to get the mime type for a specific file extension, such as:
imgtype.mime.svg
imgtype.mime.jpg
Supported extensions include:
bmp
: image/bmp
gif
: image/gif
png
: image/png
svg
: image/svg+xml
tif
: image/tiff
jpg
: image/jpeg
Image file type can be detected throught the first two bytes of the file:
<?xml
or <svg
, with possibly space ahead.<?
<s
<
While image files begin with these pattern, there might still be other file formats that begin with the same pattern. Furthermore, there might be exceptions for SVG files.
Thus, this should only be considered as a hint instead of a correct result.
MIT
FAQs
detect image file type
We found that imgtype 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.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.