This package has been deprecated

Author message:

Due to Dank Memer's api being privatized, I will no longer be specifically supporting their api. See https://npm.im/imgen for a lib that covers essentially the same concepts.

dankmemerapi
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Dank Memer API

This is an api wrapper built for Dank Memer's Image Generation API.

Deprecation

As of writing this, Dank Memer has privatized their api and revoked most (if not all) api keys. If you are looking for a solution to this, I've made my own which you can see here. You can also use it through this module, by setting baseURL to https://imgen.yiff.rest/api. If you want to run it on your own, you can look at the original source, or my dockerized version (pre-rebranding, Jun 19, 2022).

JavaScript Example:

const DankMemerAPI = require("dankmemerapi");
const { writeFile } = require("fs/promises");
// only apiKey is required
const DMAPI = new DankMemerAPI({ apiKey: "api key", userAgent: "SomeUserAgent/1.0.0", baseURL: "https://dankmemer.services/api" });
DMAPI.abandon("text to provide").then(response => writeFile(`${__dirname}/abandon.png`, response.file));

TypeScript Example:

import DankMemerAPI from "dankmemerapi";
import { writeFile } from "fs/promises";
// only apiKey is required
const DMAPI = new DankMemerAPI({ apiKey: "api key", userAgent: "SomeUserAgent/1.0.0", baseURL: "https://dankmemer.services/api" });
DMAPI.abandon("text to provide").then(response => writeFile(`${__dirname}/abandon.png`, response.file));

The return of the functions is this structure (using the TS interface as an example):

interface MemeRequestResponse {
    ext: string;
    mime: string;
    file: Buffer;
}

ext will be the file extension of what was returned, mime will be the mime type of what was returned, and file will be the actual data returned.

The only function that differentiates from this is the yomomma function, which returns just a string.

Package Sidebar

Install

npm i dankmemerapi

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

62.1 kB

Total Files

14

Last publish

Collaborators

  • donovan_dmc