
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
doggo-api-wrapper
Advanced tools
doggo-api-wrapper is a simple API Wrapper for DogAPI
First install the npm package
npm i doggo-api-wrapper
or
yarn add doggo-api-wrapper
Here is a basic exemple with getARandomDog()
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getARandomDog()
.then(data => console.log(data))
.catch(err => console.error(err))
Each methods of the doggo-api-wrapper returns a promise.
getAllDogsByBreed(breed)
returns an array of all the images from a breed
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getAllDogsByBreed('hound')
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getAllSubBreedImages(breed, subBreed)
returns an array of all the images from the sub-breed
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getAllSubBreedImages('hound', 'afgan')
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getARandomDog()
displays single random image from all dogs collection
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getARandomDog()
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getARandomDogFromBreed(breed)
returns a random dog image from a breed
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getARandomDogFromBreed('hound')
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getARandomSubBreedImage(breed, subBreed)
returnss a random image from a sub breed collection
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getARandomSubBreedImage('hound', 'afgan')
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getListOfAllBreeds()
list all breeds available
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getListOfAllBreeds()
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getMultipleRandomDogs(amount)
displays multiple random images from all dogs collection
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getMultipleRandomDogs(5)
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
getSubBreedFromBreed(breed)
returns an array of all the sub-breeds from a breed
const DogApi = require('doggo-api-wrapper');
const myDog = new DogApi();
myDog.getSubBreedFromBreed('hound')
.then(data => console.log(data))
.catch(err => console.error(err)) // Don't forget the catch it's important
FAQs
A simple API wrapper for Dog API
We found that doggo-api-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.