Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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. 😻🐾
- Host: GitHub
- URL: https://github.com/sefinek24/random-cat-img
- Owner: sefinek24
- License: mit
- Created: 2022-05-15T05:54:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T05:50:01.000Z (3 months ago)
- Last Synced: 2024-09-30T13:21:47.250Z (about 2 months ago)
- Topics: 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
- Language: JavaScript
- Homepage: https://npmjs.com/package/random-cat-img
- Size: 281 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
😻 » Random cat images « 😽
Please check a more elaborate alternative: @sefinek/random-animals
» Star the repo if you liked it «
⭐
## 📑 » 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