JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q35704F
  • License MIT

Meme an animated gif with Canvas and GM

Package Exports

  • gifmeme

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gifmeme) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GifMeme NPM Version

Node.js module for creating a meme from an animated gif.

To Install

    $ npm install gifmeme

Requirements

GifMeme utilizes Automattic's node-canvas module which has some pre-requisites (Cairo) that must be installed on your machine. To find out more please check out their Wiki and then come back here.

GifMeme is also utilizing ImageMagick to finalize the output of the animated gif.

API

  • init(outputDirectoryName, fileAppendedName)
    The outputDirectoryName is where the meme file will be written to on your file system.

    fileAppendedName is a string that will be appended to the original file name. eg - if fileAppendedName = '-meme', photo.png will write out to photo-meme.png
  • generate(file, topText, bottomText, callback)
    file is the filename and location - eg. __dirname + 'public/images/photo.png'

    topText and bottomText are the text that will be overlayed on the top and bottom of the photo respectively.
    callback will return the filename or an error

Example Uses -

var gifmeme = require('gifmeme');
gifmeme.init('./tmp', '-meme');
gifmeme.generate('./photo.gif', 'Top of Meme', 'Bottom of Meme', function(error, memefilename){
    if(error){
        console.log(error);
    } else {
        console.log(memefilename);
    }
});