
Security News
Federal Audit Finds NIST Wasted Funds With No Plan to Clear NVD Backlog
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.
check-image-type
Advanced tools
support image type:
WEBP,
JPG,
PNG,
GIF,
BMP,
AVIF,
HEIC,
BPG,
ICO,
PSD,
JXR,
FLIF,
ICNS,
ORF,
XCF,
RW2,
KTX,
JXL,
CUR,
RAF
npm install check-image-type
import { checkImage, JPG, isJPG} from 'check-image-type'
const buffer = readFileSync("test.jpg");
expect(checkImage(buffer)).toEqual(JPG);
assert(isJPG(buffer))
export const WEBP = {
ext: "webp",
mime: "image/webp",
} as const;
export type WEBP_TYPE = typeof WEBP;
export const JPG = {
ext: "jpg",
mime: "image/jpeg",
} as const;
export type JPG_TYPE = typeof JPG;
export const PNG = {
ext: "png",
mime: "image/png",
} as const;
export type PNG_TYPE = typeof PNG;
export const BMP = {
ext: "bmp",
mime: "image/bmp",
} as const;
export type BMP_TYPE = typeof BMP;
export const GIF = {
ext: "gif",
mime: "image/gif",
} as const;
export type GIF_TYPE = typeof GIF;
export const AVIF = {
ext: "gif",
mime: "image/gif",
} as const;
export type AVIF_TYPE = typeof AVIF;
export const HEIC = {
ext: "gif",
mime: "image/gif",
} as const;
export type HEIC_TYPE = typeof HEIC;
FAQs
Detect the image type of Buffer/Uint8Array
We found that check-image-type 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.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.