Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

random-cat-img

sefinek15.1kMIT1.1.8TypeScript support: included

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

api, bot, cat, cats, image, images, random, random-cat, random-cat-api, random-cat-apis, random-cat-image, random-cat-images, random-cat-img, random-cat-img-api, random-cat-img-apis, random-cats, random-kitten, random-kitten-api, random-kitten-apis, random-kitten-image, random-kitten-images, random-kitten-img, random-kitten-img-api, random-kitten-img-apis, random-kittens

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 API using native module like https. Each image is appropriately compressed.

😼 » Installation

npm install random-cat-img

🐈 » Usage

• Importing

const getRandomCat = require('random-cat-img');

• Async/await example

(async () => {
    const data = await getRandomCat();
    console.log(data.message); // https://cdn.sefinek.net/images/animals/cat/cat-1362565-min.jpg
})();

• Promise example

getRandomCat().then(data => console.log(data.message)); // https://cdn.sefinek.net/images/animals/cat/my-cat-1384175-min.jpg

• Returned object

{
  "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 if you have any questions or issues related to this module or API.

If you like this module, please star the repository.

📜 » License MIT

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