Cat is an API wrapper that allows you to easily generate pictures of cats (Powered by TheCatAPI).
Repository
Current version released
5 years ago
Versions
Cat - an API wrapper. 😺
API Wrapper for TheCatAPI.com written in Deno!
Usage
import Cat from "./mod.js";
/* Fetch all of the cat breeds */
let breeds = await Cat.getBreeds(); // returns an array of breeds
console.log(breeds); //> [ "item", "here" ]
/* Fetch a singular cat (random breed) */
console.log(await Cat.getCat()); //> [ "<url>" ]
/* Fetch a singular cat (specified breed) */
console.log(await Cat.getCat({ breed: breeds[Math.floor(Math.random() * breeds.length)] })); //> [ "<url>" ]
/* Fetch a multiple bengal cats from a specific page */
console.log(await Cat.getCat({ breed: "beng", limit: 10, page: 2 })); //> [ "<url>" ] (length -> 10)