Socket
Socket
Sign inDemoInstall

is-image-header

Package Overview
Dependencies
9
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-image-header

This module checks if the URL leads to a photo by analyzing the header.


Version published
Maintainers
1
Install size
2.12 MB
Created

Readme

Source

🌍 » What is that?

This module checks if the URL leads to a photo by analyzing the header.

🤔 » 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, error: false, isImage: true }

    const example2 = await isImage('https://sefinek.net');
    console.log(example2); // { success: true, status: 200, error: false, 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, error: false, isImage: true }
isImage('https://sefinek.net').then(console.log); // { success: true, status: 200, error: false, isImage: false }

🤝 » Help

Open new Issue on GitHub.

⭐ » Star

If you like this module, please star the repository.

📜 » License MIT

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

Keywords

FAQs

Last updated on 13 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc