🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More
Socket
Sign inDemoInstall
Socket

memeforge

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memeforge

A powerful Node.js library for creating memes, image effects, and funny visuals with ease.

1.0.2
latest
Source
npm
Version published
Weekly downloads
4
100%
Maintainers
0
Weekly downloads
 
Created
Source

MemeForge

MemeForge is a powerful and flexible meme generation library using Node.js and Canvas. It provides several generators for creating classic memes, demotivators, and images with quotes from great people.

🚀 Installation

Install the library via npm:

npm install memeforge

✨ Features

  • ClassicMemeGenerator: Generate classic memes with upper and lower text.
  • DemotivatorGenerator: Creating demotivators with custom fonts and sizes.
  • GreatPeopleQuoteGenerator: Generate images with quotes from great people.

📖 Usage

Example of using ClassicMemeGenerator:

import { ClassicMemeGenerator } from 'memeforge';

const meme = new ClassicMemeGenerator('path/to/image.jpg');

(async () => {
    await meme.generate('Top text', 'Bottom text');
    meme.saveToFile("output.png");
})();

Example of using DemotivatorGenerator:

import { DemotivatorGenerator } from 'memeforge';

const demotivator = new DemotivatorGenerator('path/to/image.jpg');

(async () => {
    await demotivator.generate('Title', 'Subtitle');
    demotivator.saveToFile("output.png");
})();

Example of using GreatPeopleQuoteGenerator:

import { GreatPeopleQuoteGenerator } from 'memeforge';

const quoteImage = new GreatPeopleQuoteGenerator('path/to/avatar.jpg');

(async () => {
    await quoteImage.generate('Title', 'Quote', 'Author');
    quoteImage.saveToFile("output.png");
})();

✏️ Customization

Each generator supports font settings via the FontSettings object. Example:

import { FontSettings } from 'memeforge';

const fontSettings = new FontSettings(
    'Arial',  // Font
    40,       // Font size
    'italic', // Font style (normal, italic, bold, etc.)
    'yellow', // Text color
    'red',    // Border color
    5         // Border thickness
);

These settings can be passed to the generator constructor:

const meme = new ClassicMemeGenerator('path/to/image.jpg', fontSettings);

⚙️ Dependencies

  • canvas: For working with images.
  • Node.js version 16+.

📜 License

MemeForge is distributed under the MIT license. See the LICENSE file for details.

Create memes quickly and easily with MemeForge!

Keywords

meme

FAQs

Package last updated on 27 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts