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

devcodes-meme-generator

v1.0.3

Published

Turn any image into a meme or generate from 200+ templates. Zero API key required.

Readme

devcodes-meme-generator

Generate memes from 200+ templates, add text to any image URL, or fetch real memes from Reddit — zero API keys required.

Built on top of devcodes-http-tool and powered by memegen.link + meme-api.com.

Install

npm install devcodes-meme-generator devcodes-http-tool

Usage

Quick start (default instance)

const { fromTemplate, fromImage, fromSubreddit } = require('devcodes-meme-generator');

// Generate from a named template with text
const meme = await fromTemplate('buzz', ['When you', 'write clean code']);
console.log(meme.url); // https://api.memegen.link/images/buzz/...

// Add text to any image URL
const custom = fromImage('https://example.com/cat.jpg', ['top text', 'bottom text']);
console.log(custom.url);

// Fetch a real meme from Reddit (no text needed)
const reddit = await fromSubreddit('panda');
console.log(reddit.title, reddit.url);

Custom instance

const { MemeClient } = require('devcodes-meme-generator');

const meme = new MemeClient({ timeout: 5000 });

// Search for templates
const results = await meme.searchTemplates('drake');
console.log(results[0].id); // "drake"

// Generate with top/bottom text
const { url } = await meme.fromTemplate('drake', ['Using Axios', 'Using devcodes-http-tool']);

// Custom image overlay
const { url: custom } = meme.fromImage('https://i.imgur.com/abc.jpg', ['top', 'bottom']);

// Reddit fetch — safe subreddits only
const post = await meme.fromSubreddit('dankmemes');
console.log(post.title, post.url, post.ups);

TypeScript

import { MemeClient, fromTemplate, fromSubreddit } from 'devcodes-meme-generator';
import type { MemeResult, SubredditMemeResult } from 'devcodes-meme-generator';

const result: MemeResult = await fromTemplate('panda', ['nobody:', 'me at 3am']);
const post: SubredditMemeResult = await fromSubreddit('programmerhumor');

API

fromTemplate(template, lines?)

Generates a meme image URL from a template name or ID.

  • template — template ID (e.g. "buzz") or search term (e.g. "panda")
  • lines — array of text strings, top to bottom. Omit for default template text.
  • Returns Promise<MemeResult>

fromImage(imageUrl, lines?)

Overlays meme text onto any image URL. Synchronous — returns immediately.

  • imageUrl — publicly accessible image URL
  • lines — array of text strings
  • Returns MemeResult

fromSubreddit(subreddit?)

Fetches a random meme post from a safe subreddit. Auto-retries if NSFW.

  • subreddit — one of memes, dankmemes, programmerhumor, me_irl, shitposting, panda. Defaults to memes.
  • Returns Promise<SubredditMemeResult>

MemeClient.searchTemplates(query)

Returns matching templates from memegen.link filtered by keyword.

  • Returns Promise<MemeTemplate[]>

Supported templates (examples)

| ID | Name | |---|---| | buzz | Buzz Lightyear — Everywhere | | drake | Drake Approves | | doge | Doge | | panda | Panda | | distracted | Distracted Boyfriend | | fine | This Is Fine | | gru | Gru's Plan | | success | Success Kid |

Browse all 200+ at api.memegen.link/templates.

Discord bot example

// d!meme panda              → Reddit fetch from r/panda
// d!meme buzz top | bottom  → Template with text
// d!meme https://i.imgur.com/abc.jpg top | bottom → Custom image

const { MemeClient } = require('devcodes-meme-generator');
const meme = new MemeClient();

client.on('messageCreate', async (message) => {
  if (!message.content.startsWith('d!meme')) return;

  const raw     = message.content.slice(6).trim();
  const spaceIdx = raw.indexOf(' ');
  const subject  = spaceIdx === -1 ? raw : raw.slice(0, spaceIdx);
  const lines    = spaceIdx === -1 ? [] : raw.slice(spaceIdx + 1).split('|').map(s => s.trim());

  if (/^https?:\/\//i.test(subject)) {
    const { url } = meme.fromImage(subject, lines);
    await message.reply(url);
  } else if (lines.length === 0) {
    const post = await meme.fromSubreddit(subject);
    await message.reply(post.url);
  } else {
    const { url } = await meme.fromTemplate(subject, lines);
    await message.reply(url);
  }
});

License

MIT © azaresw

Support

Join our Discord for help and updates: discord.gg/ESh2Dp2xX9