random-cat-img
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

😻 » 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 © by Sefinek. All Rights Reserved.

Package Sidebar

Install

npm i random-cat-img

Weekly Downloads

532

Version

1.1.5

License

MIT

Unpacked Size

9.16 kB

Total Files

11

Last publish

Collaborators

  • sefinek