Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sefinek24/random-cat-img

An npm module that provides random cat images. Fast and reliable. 😻🐾
https://github.com/sefinek24/random-cat-img

animal animals cat cats images node-js npm-module npm-package random random-cat random-cat-api random-cat-image random-cats random-kitten random-kittens

Last synced: about 1 month ago
JSON representation

An npm module that provides random cat images. Fast and reliable. 😻🐾

Awesome Lists containing this project

README

        


😻 » Random cat images « 😽


Random cat
Please check a more elaborate alternative: @sefinek/random-animals


» Star the repo if you liked it «



The number of downloads
Issues
Last commit
Commit activity
Code size

## 📑 » About
This module retrieves random cat images from the [api.sefinek.net](https://api.sefinek.net) API using native module like [https](https://nodejs.org/api/https.html).
Each image is appropriately compressed.

## 😼 » Installation
```bash
npm install random-cat-img
```

## 🐈 » Usage
### • Importing
```js
const getRandomCat = require('random-cat-img');
```
### • Async/await example
```js
(async () => {
const data = await getRandomCat();
console.log(data.message); // https://cdn.sefinek.net/images/animals/cat/cat-1362565-min.jpg
})();
```
### • Promise example
```js
getRandomCat().then(data => console.log(data.message)); // https://cdn.sefinek.net/images/animals/cat/my-cat-1384175-min.jpg
```
### • Returned object
```json
{
"success": true,
"status": 200,
"info": { "category": "animals", "endpoint": "cat" },
"message": "https://cdn.sefinek.net/images/animals/cat/neva-masquerade-cats-1375033-min.jpg"
}
```

## ✨ » Final information
Open a new [Issue](https://github.com/sefinek24/random-cat-img/issues/new) if you have any questions or issues related to this module or API.

If you like this module, please star [the repository](https://github.com/sefinek24/random-cat-img).

## 📜 » License MIT


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