1.1.0 • Published 4 years ago
ranimals v1.1.0
How can i install this package?
npm install ranimals
What does this package do?
It returns a promise for a random image url of a specified animal
How can i use this package?
// IMPORTANT NOTE: You have to use async/await if you don't use .then() | .catch() because it returns a promise.
const animals = require('ranimals');
//Dog
animals.dog()
.then(url => console.log(url))
.catch(error => console.log(error));
//Cat
animals.cat()
.then(url => console.log(url))
.catch(error => console.log(error));
//Fox
animals.fox()
.then(url => console.log(url))
.catch(error => console.log(error));
//Bear
animals.bear()
.then(url => console.log(url))
.catch(error => console.log(error));