This module retrieves random cat images from the api.sefinek.net API using native module like https. Each image is appropriately compressed.
npm install random-cat-img
const getRandomCat = require('random-cat-img');
(async () => {
const data = await getRandomCat();
console.log(data.message); // https://cdn.sefinek.net/images/animals/cat/cat-1362565-min.jpg
})();
getRandomCat().then(data => console.log(data.message)); // https://cdn.sefinek.net/images/animals/cat/my-cat-1384175-min.jpg
{
"success": true,
"status": 200,
"info": { "category": "animals", "endpoint": "cat" },
"message": "https://cdn.sefinek.net/images/animals/cat/neva-masquerade-cats-1375033-min.jpg"
}
Open a new Issue if you have any questions or issues related to this module or API.
If you like this module, please star the repository.
Copyright 2023-2024 © by Sefinek. All Rights Reserved.