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

fish-joke-generator

v1.1.0

Published

A delightful tool for generating hilarious fish-themed jokes. Compatible with AI SDK (Vercel), OpenAI SDK 6, and Zod 4.

Downloads

55

Readme

Fish Joke Generator

Use the Fish Joke Generator tool in your AI SDK agent with just a few lines of code.

Installation

npm install fish-joke-generator

Usage

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { getFishJokeTool } from 'fish-joke-generator';

const result = await generateText({
  model: openai('gpt-4'),
  prompt: 'Tell me a funny fish joke',
  tools: {
    getFishJoke: getFishJokeTool(),
  },
  maxSteps: 5,
});

console.log(result.text);

Quick Start (Without AI SDK)

import { getRandomFishJoke } from 'fish-joke-generator';

const joke = getRandomFishJoke();
console.log(`${joke.setup}\n${joke.punchline}`);

Available Tools

getFishJokeTool()

Returns a tool for AI SDK that generates fish jokes.

Parameters:

  • category (optional): 'pun' | 'dad' | 'ocean' | 'random'
  • rating (optional): 'family-friendly' | 'groan-worthy' | 'fin-tastic'

Example:

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { getFishJokeTool } from 'fish-joke-generator';

const result = await generateText({
  model: openai('gpt-4'),
  prompt: 'Tell me a groan-worthy fish pun',
  tools: {
    getFishJoke: getFishJokeTool(),
  },
});

getMultipleFishJokesTool()

Returns a tool for AI SDK that generates multiple fish jokes.

Parameters:

  • count: number of jokes to generate
  • category (optional): 'pun' | 'dad' | 'ocean' | 'random'

Example:

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { getMultipleFishJokesTool } from 'fish-joke-generator';

const result = await generateText({
  model: openai('gpt-4'),
  prompt: 'Give me 3 ocean-themed fish jokes',
  tools: {
    getMultipleFishJokes: getMultipleFishJokesTool(),
  },
});

Direct API Usage

getRandomFishJoke(category?)

Get a random fish joke without using the AI SDK.

import { getRandomFishJoke } from 'fish-joke-generator';

const joke = getRandomFishJoke('pun');
console.log(joke.setup);     // "What do you call a fish with no eyes?"
console.log(joke.punchline); // "A fsh!"

createFishJoker(options?)

Create a fish joker instance with custom options.

import { createFishJoker } from 'fish-joke-generator';

const joker = createFishJoker();

// Get a single joke
const joke = joker.getJoke('dad');

// Get multiple jokes
const jokes = joker.getJokes(5, 'ocean');

// Get all jokes from a category
const allPuns = joker.getJokesByCategory('pun');

// Format a joke
console.log(joker.formatJoke(joke, 'question-answer'));

TypeScript Types

interface FishJoke {
  setup: string;
  punchline: string;
  category: 'pun' | 'dad' | 'ocean' | 'random';
  rating?: 'family-friendly' | 'groan-worthy' | 'fin-tastic';
}

type JokeCategory = 'pun' | 'dad' | 'ocean' | 'random';

interface JokeOptions {
  rating?: 'family-friendly' | 'groan-worthy' | 'fin-tastic';
  includeCategory?: boolean;
  format?: 'standard' | 'one-liner' | 'question-answer';
}

Example Jokes

Puns:

  • "What do you call a fish that practices medicine?" → "A sturgeon!"
  • "What do you call a fish magician?" → "A magic carp!"

Dad Jokes:

  • "Did you hear about the fish that went bankrupt?" → "Now he's a loan shark!"
  • "What did the fish say when he posted bail?" → "I'm off the hook!"

Ocean Humor:

  • "Why are fish so smart?" → "Because they live in schools!"
  • "How do shellfish get to the hospital?" → "In a clambulance!"

Features

  • 🐟 23+ hand-crafted fish jokes
  • 🤖 AI SDK compatible tools
  • ✅ Full TypeScript support
  • 🎲 Random joke selection
  • ⭐ Joke ratings and categories
  • 🎨 Multiple formatting options
  • 📦 Zero dependencies (AI SDK is peer dependency)

Use Cases

  • Add humor to AI chatbots and agents
  • Generate entertaining placeholder content
  • Create comedy applications
  • Lighten up error messages
  • Icebreakers for meetings
  • Educational marine life content

Contributing

Have a fin-tastic fish joke to add? Contributions are welcome! Please submit a Pull Request.

License

MIT


Made with ❤️ and 🐟 for the AI SDK community