animality
A simple API wrapper that generates images & facts of any animal
Update log
1.2.7
(Latest) -
- Added Case Sensitive Types.
- Duplicates in the parameters are now filtered.
Other
- Objects can be passed as parameters.
- Code made cleaner
- Miner Bug fixes
Installation
Use the package manager npm to install animality
$ npm i animality
Require
const animality = require("animality");
Usage
Animals:
cat
dog
bird
panda
redpanda
koala
fox
whale
kangaroo
bunny
Get information of a specific animal
const animality = require("animality");
const animals = ["cat", "dog", "bird", "panda", "redpanda", "koala", "fox", "whale", "kangaroo", "bunny"];
const animal = "cat";
animality.getAsync(animal).then(data => {
console.log(data);
})
Output:
{
"image": "random cat image link",
"fact": "random cat fact"
}
Get information of a random Animal
const animality = require("animality");
const animal = "random";
animality.getAsync(animal).then(data => {
console.log(data);
})
Output:
{
"name": "animal name",
"image": "random animal image link",
"fact": "random animal fact"
}
Get information of multiple animals at once
const animality = require("animality");
const animals = ["cat", "dog", "kangaroo"];
animality.getAsync(animals).then(data => {
console.log(data);
})
Output:
[
{
"name": "cat",
"image": "random cat image link",
"fact": "random cat fact"
},
{
"name": "dog",
"image": "random dog image link",
"fact": "random dog fact"
},
{
"name": "kangaroo",
"image": "random kangaroo image link",
"fact": "random kangaroo fact"
}
]