Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

da-cathub/nodejs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cathub-api

WOW Cathub has a API?!

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
	}
]

Way to use it!

cathub.random

• howManyCats - Defaults to 1 else needs to be Number between 1-100

Sample

const cathub = require("cathub-api")

cathub.random(2).then(console.log)

cathub.get()

• id - NEEDS to be a String with valid id of image on CatHub, else returns an Object with an error property

Sample

const cathub = require("cathub-api")

cathub.id("ycg2x0qa").then(console.log)

cathub.author()

• id - NEEDS to be a String with valid id of an user on CatHub, else returns an Object with an error property

Sample

const cathub = require("cathub-api")

cathub.author("da.charliecatto").then(console.log)

About

Node.JS Wrapper for CatHub’s API!

Resources

License

Stars

Watchers

Forks

Packages

No packages published