memegen-m2k
v1.0.0
Published
Generate Memes with the help of APIMeme Meme Generator
Downloads
10
Maintainers
Readme
Memegen
Generate Memes with the help of API Meme Meme Generator. Support the official API website here.
Installation
npm i memegen-m2k --save
or
yarn add memegen-m2k
How to use
Import Library
const MemeGen = require('memegen-m2k');
Get All the meme options
console.log(MemeGen.getMemeOptions().length)
Generate Meme Image URL
const list = MemeGen.getMemeOptions();
const index = parseInt(Math.random() * list.length);
const meme = list[index]; // Pick one at random
// top and bottom text of the meme
const topText = "When she says no"
const topBottom = "When he says no"
// print out image link of the meme
console.log(MemeGen.generate(meme, topText, topBottom))