3.0.4 • Published 2 months ago

is-image-header v3.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

🌍 » 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

3.0.4

2 months ago

3.0.3

5 months ago

3.0.2

5 months ago

3.0.1

7 months ago

3.0.0

7 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago