garyapi
v1.0.1
Published
A simple Node.js client for the Gary the Cat API 🐾
Maintainers
Readme
garyapi 🐾
A tiny Node.js client for interacting with the Gary the Cat API.
Get images, quotes, jokes, and more — all powered by Gary and Goober.
📦 Installation
npm install garyapi🧪 Usage
const GaryAPI = require("garyapi");
const gary = new GaryAPI();
(async () => {
console.log(await gary.getGary()); // JSON: Random Gary image URL
console.log(await gary.getGoober()); // JSON: Random Goober image URL
console.log(await gary.getQuote()); // Quote string
console.log(await gary.getJoke()); // Joke string
const garyBuffer = await gary.getGaryImageBuffer(); // Buffer of random Gary image
const gooberBuffer = await gary.getGooberImageBuffer(); // Buffer of random Goober image
// You could save the image, send it to Discord, etc.
})();📚 API
| Method | Returns | Description |
|----------------------------|----------------------|-------------------------------------|
| getGary() | Promise<string> | Random Gary image URL (JSON) |
| getGoober() | Promise<string> | Random Goober image URL (JSON) |
| getQuote() | Promise<string> | Random quote |
| getJoke() | Promise<string> | Random joke |
| getGaryImageBuffer() | Promise<Buffer> | Raw Gary image data as a buffer |
| getGooberImageBuffer() | Promise<Buffer> | Raw Goober image data as a buffer |
🐈 License
See LICENSE (aka The Gary License).
