A lightweight TypeScript library for generating random content — cats, dogs, jokes, memes, advice, facts, and more.
npm install some-random-catUp and running in under a minute — install, import one class, and start fetching content.
Install
Add the package using npm, yarn, or pnpm.
npm install some-random-cat # or with yarn / pnpm yarn add some-random-cat
Import
Three named exports — pick what you need.
// CommonJS const { Random, Generation, Util } = require('some-random-cat'); // ESM / TypeScript import { Random, Generation, Util } from 'some-random-cat';
Fetch a random cat
All Random methods are async — use await or .then().
const cat = await Random.getCat(); console.log(cat.url); // https://cdn2.thecatapi.com/... console.log(cat.width); // 640
Generate a UUID
Generation methods are synchronous — no await needed.
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.