npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aicats/sdk

v1.3.0

Published

Official JavaScript SDK for the ai-cats.net API

Readme

🐱 ai-cats-sdk

Official JavaScript/TypeScript SDK for the ai-cats.net API - Get AI-generated cat images!

Installation

npm install @aicats/sdk

Quick Start

import { AiCats, Theme, Size } from '@aicats/sdk';

// Get a random cat image
const imageBlob = await AiCats.random();

// Get a Halloween-themed cat
const spookyCat = await AiCats.random({ theme: Theme.Halloween });

// Search for cats
const results = await AiCats.search({ query: 'orange fluffy cat', limit: 10 });

API Reference

AiCats.random(options?)

Get a random AI-generated cat image.

const blob = await AiCats.random({
  size: Size.Medium,       // Image size (default: Large)
  theme: Theme.Xmas,       // Optional theme
  responseType: 'blob'     // 'blob' | 'arrayBuffer' | 'base64' | 'dataUrl'
});

// Get as base64
const base64 = await AiCats.random({ responseType: 'base64' });

// Get as data URL (for direct use in img.src)
const dataUrl = await AiCats.random({ responseType: 'dataUrl' });

AiCats.getById(id, options?)

Get a specific cat image by ID.

const blob = await AiCats.getById('669de24a-1da1-4fcd-84b1-9e55a43a0e0e', { size: Size.Small });

// Get as base64
const base64 = await AiCats.getById('669de24a-1da1-4fcd-84b1-9e55a43a0e0e', { responseType: 'base64' });

// Get as data URL
const dataUrl = await AiCats.getById('669de24a-1da1-4fcd-84b1-9e55a43a0e0e', { responseType: 'dataUrl' });

AiCats.getInfo(id)

Get detailed information about a cat image.

const info = await AiCats.getInfo('669de24a-1da1-4fcd-84b1-9e55a43a0e0e');
console.log(info.prompt);      // "In a futuristic space observatory..."
console.log(info.theme);       // "Default"
console.log(info.dateCreated); // 1724534067586

AiCats.search(options?)

Search for cat images.

const results = await AiCats.search({
  query: 'rainbow',       // Search text
  limit: 20,              // Max results (1-100)
  theme: Theme.Halloween, // Filter by theme
  descending: true        // Newest first
});

for (const cat of results) {
  console.log(cat.id, cat.url);
}

AiCats.getSimilar(id, options?)

Find cats similar to a given cat.

const similar = await AiCats.getSimilar('669de24a-1da1-4fcd-84b1-9e55a43a0e0e', { limit: 5 });

AiCats.getThemes()

Get all available themes.

const themes = await AiCats.getThemes();
// ['Default', 'Spring', 'Summer', 'Halloween', 'Xmas', ...]

AiCats.getCount(theme?)

Get the total number of cat images.

const total = await AiCats.getCount();
const halloweenCount = await AiCats.getCount(Theme.Halloween);

Types

ResponseType

'blob'        // Blob object (default)
'arrayBuffer' // ArrayBuffer
'base64'      // Base64 encoded string
'dataUrl'     // Data URL (data:image/jpeg;base64,...)

Size

Size.Large     // 1024x1024 (default)
Size.Medium    // 512x512
Size.Small     // 256x256
Size.Thumbnail // 128x128
Size.Icon      // 64x64
Size.Tiny      // 32x32
Size.Micro     // 16x16

Theme

Theme.Default
Theme.Spring
Theme.Summer
Theme.Autumn
Theme.Winter
Theme.Halloween
Theme.Xmas
Theme.NewYear
Theme.Easter

Browser Usage

<script type="module">
  import { AiCats } from 'https://unpkg.com/@aicats/sdk/dist/index.mjs';
  
  const blob = await AiCats.random();
  const img = document.createElement('img');
  img.src = URL.createObjectURL(blob);
  document.body.appendChild(img);
</script>

Requirements

  • Node.js 18+ (uses native fetch)
  • Modern browsers (Chrome, Firefox, Safari, Edge)

License

MIT © Mario Bertsch