Socket
Book a DemoInstallSign in
Socket

doggo-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doggo-api-wrapper

A simple API wrapper for Dog API

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

npm version npm Dependency Status

What is doggo-api-wrapper ?

doggo-api-wrapper is a simple API Wrapper for DogAPI

How to use it ?

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.

List of all methods

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

Keywords

api

FAQs

Package last updated on 06 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.