some-random-cat
npm packagev2.4.0 stable

some-random-cat

A lightweight TypeScript library for generating random content — cats, dogs, jokes, memes, advice, facts, and more.

Cat imagesDog imagesJokesMemesAdviceTopicsUUID genTypeScript
npm install some-random-cat

Getting Started

Up and running in under a minute — install, import one class, and start fetching content.

01

Install

Add the package using npm, yarn, or pnpm.

bash
npm install some-random-cat
# or with yarn / pnpm
yarn add some-random-cat
02

Import

Three named exports — pick what you need.

javascript
// CommonJS
const { Random, Generation, Util } = require('some-random-cat');

// ESM / TypeScript
import { Random, Generation, Util } from 'some-random-cat';
03

Fetch a random cat

All Random methods are async — use await or .then().

javascript
const cat = await Random.getCat();
console.log(cat.url);   // https://cdn2.thecatapi.com/...
console.log(cat.width); // 640
04

Generate a UUID

Generation methods are synchronous — no await needed.

javascript
const id  = Generation.generateId({ putDash: true });
// "a1b2c3d4-e5f6-4789-yabc-def012345678"

const acr = Generation.getAcronym('World Health Organization');
// "WHO"

What's included

Object-Oriented

Three focused static classes — Random, Generation, Util.

TypeScript-First

Full type declarations and exported interfaces included.

Promise-Based

Async methods return typed Promises. Works great with await.

Multi-API

Cat API, dog.ceo, AdviceSlip and more — one interface.

some-random-cat · v2.4.0 · ISC License · Aktindo