1.0.7 • Published 6 years ago
random.dog v1.0.7
random.dog
I made this package because I was testing things out in JS. I guess people can find this usefull :)
Setup
First of all you need to install the package using npm install random.dog
.
After this, just import the package, create a "new" instance of it and call it!
Example:
const random_dog = require('random.dog');
const dog = new random_dog();
// Use this to get a new dog! (Image && Video)
dog.getDog().then(dog => console.log(dog)).catch(err => console.error(err));
// You can always do this tho, of course
const random_dog = require('random.dog');
const dog = new random_dog().getDog().then(dog => console.log(dog)).catch(err => console.error(err));
Example 2 (Used in ASYNC functions):
const random_dog = require('random.dog');
const dog = new random_dog();
// Let's pretend the things bellow are inside an async function
// final_dog will now contain the url returned from dog.getDog();
const final_dog = await dog.getDog();