4.0.0 • Published 7 years ago

gifmeme v4.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
7 years ago

GifMeme NPM Version

Node.js module for creating a meme from an animated gif will work with static images too such as jpeg and png.

To Install

    $ npm install gifmeme

Requirements

Nodejs 6.4.0+ (utilizes es6 promises.)

GifMeme is utilizing ImageMagick to finalize the output of the animated gif. Please insure that ImageMagick is installed locally.

API

  • init on require - eg require ('gifmeme')(outputDirectoryName, fileAppendedName)

    outputDirectoryName (optional, default is './tmp') is where the meme file will be written to on your file system.

    fileAppendedName (optional, default is '-meme') 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)

    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.

    this function will return a promise with the filename of the generated meme. If an error occurs the promise will throw a rejection with the error.

Example Code

var gifmeme = require('gifmeme')();
try{
    gifmeme.generate('./test.gif', 'Top of Meme', 'Bottom of Meme').then(memeFilename => {
        console.log('Meme Generated to :' + memeFilename);
    });
} catch(e){
    console.log(e);
}

#Test Example

You can simply run the test.js file included with this repository

> node test.js
4.0.0

7 years ago

3.0.0

7 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago