Skip to content

connuh/dog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dog - an API wrapper. 🐶

API Wrapper for TheDogAPI.com written in Deno!


Usage

import Cat from "./mod.js";

/* Fetch all of the cat breeds */
import Dog from "./mod.js";

/* Fetch all of the different breeds */
let breeds = await Dog.getBreeds(); // returns an array of breeds
// console.log(breeds); //> [ "{ id: <id>, name: 'Name Here' }" ]

/* Fetch a singular dog (random breed) */
console.log(await Dog.getDog()); //> [ "url" ]

/* Fetch a singular dog (specified breed) */
console.log(await Dog.getDog({ breed: breeds[Math.floor(Math.random() * breeds.length)].id })); //> [ "url" ]

/* Fetch multiple dogs (breed id -> 1) */
console.log(await Dog.getDog({ breed: 1, limit: 10 })); //> [ "url" ] (length -> 10)

Contributions

All contributions are accepted, simply open an Issue / Pull request.

About

API Wrapper for TheDogAPI.com written in Deno (https://deno.land)!

Resources

License

Stars

Watchers

Forks

Packages

No packages published