Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

is-image-header

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-image-header

This simple module checks if the given link leads to an image.

latest
Source
npmnpm
Version
3.1.0
Version published
Maintainers
1
Created
Source

🌍 » What does it do?

This simple module checks if the given link leads to an image.

🤔 » Installation

npm install is-image-header

📝 » Usage

• Async/await example

const isImage = require('is-image-header');

(async () => {
    const example1 = await isImage('https://cdn.sefinek.net/images/animals/cat/cat-story-25-1377426-min.jpg');
    console.log(example1); // { success: true, status: 200, isImage: true }

    const example2 = await isImage('https://sefinek.net');
    console.log(example2); // { success: true, status: 200, isImage: false }
})();

• Promise example

const isImage = require('is-image-header');

isImage('https://cdn.sefinek.net/images/animals/cat/cat-story-25-1377426-min.jpg').then(console.log); // { success: true, status: 200, isImage: true }
isImage('https://sefinek.net').then(console.log); // { success: true, status: 200, isImage: false }

🤝 » Support

Join our Discord server or open a new Issue.

⭐ » Star

If you enjoy this module, please consider starring the repository.

📜 » License MIT

Copyright 2023-2024 © by Sefinek. All Rights Reserved.

Keywords

check

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

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.

Install

Related posts