https://github.com/sefinek/is-image-header
This simple module checks if the given link leads to an image.
https://github.com/sefinek/is-image-header
header headers image is jpeg jpg photo png url
Last synced: 6 months ago
JSON representation
This simple module checks if the given link leads to an image.
- Host: GitHub
- URL: https://github.com/sefinek/is-image-header
- Owner: sefinek
- License: mit
- Created: 2022-05-15T07:35:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-10T03:13:26.000Z (11 months ago)
- Last Synced: 2025-04-09T22:53:29.698Z (6 months ago)
- Topics: header, headers, image, is, jpeg, jpg, photo, png, url
- Language: JavaScript
- Homepage: https://npmjs.com/package/is-image-header
- Size: 534 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🌍 » What does it do?
This simple module checks if the given link leads to an image.## 🤔 » Installation
```bash
npm install is-image-header
````## 📝 » Usage
### • Async/await example
```js
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
```js
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](https://discord.gg/53DBjTuzgZ) or open a new [Issue](https://github.com/sefinek/is-image-header/issues).## ⭐ » Star
If you enjoy this module, please consider starring [the repository](https://github.com/sefinek/random-cat-img).## 📜 » License MIT