A wrapper for Cathub’s API
// ============= index.js
const cathub = require(`cathub-api`)
cathub.random(2).then(console.log)
// ============= console.log
[
{
"id":"ycg2x0qa",
"author":"CharlieCat",
"imageURL":"https://cdn.cathub.space/cyp/IMG_5258.webp",
"type":"img",
"ghost":false
},{
"id":"llelm4c7rm",
"imageURL":"https://cdn.cathub.space/117620014_306007537513180_3043951134926672532_n.webp",
"author":"CharlieCat",
"catName":"Not known",
"description":"I woud like to eat your nuggets",
"type":"img",
"ghost":false
}
]
• howManyCats - Defaults to
1
else needs to beNumber
between1-100
Sample
const cathub = require("cathub-api")
cathub.random(2).then(console.log)
• id - NEEDS to be a String with valid id of image on CatHub, else returns an
Object
with an error propertySample
const cathub = require("cathub-api")
cathub.id("ycg2x0qa").then(console.log)
• id - NEEDS to be a String with valid id of an user on CatHub, else returns an
Object
with an error propertySample
const cathub = require("cathub-api")
cathub.author("da.charliecatto").then(console.log)