šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

node-dogandcat

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

node-dogandcat

A package to get a random dog and cat picture or fact from a public api.

1.1.0
latest
Source
npm
Version published
Weekly downloads
3
-75%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Description:

A simple node package to get a image and a fact about cats and dogs.

Installation:

npm i node-dogandcat --save

Usage:

const random = require('node-dogandcat');
random.getRandomDog() // Returns a promise containing the image url that you can resolve.
.then(result => console.log(result))
.catch(err => console.error(err));

random.getRandomDogFact() // Returns a promise containing the random dog fact that you can resolve. You can also specify the amount to get as a function argument, but the default is 1, if the amount is more than 1, it will return an array.
.then(result => console.log(result))
.catch(err => console.error(err));

random.getRandomCatFact() // Returns a promise containing the random cat fact that you can resolve. You can also specify the amount to get as a function argument, but the default is 1, if the amount is more than 1, it will return an array.
.then(result => console.log(result))
.catch(err => console.error(err));

random.getRandomCat() // Returns a promise containing the image url that you can resolve.
.then(result => console.log(result))
.catch(err => console.error(err)); 

Keywords

dog

FAQs

Package last updated on 03 Jul 2019

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