is-image-header
v3.1.0
Published
This simple module checks if the given link leads to an image.
Downloads
709
Maintainers
Readme
🌍 » 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.