3.0.0 • Published 3 years ago

imgflip v3.0.0

Weekly downloads
30
License
MIT
Repository
github
Last release
3 years ago

Install

$ npm i imgflip

Usage

import Imgflip from 'imgflip'

// https://imgflip.com/signup
const imgflip = new Imgflip({
  username: 'YOUR_USERNAME',
  password: 'YOUR_PASSWORD'
})

// https://api.imgflip.com/get_memes
// Get top 100 popular meme formats
const memes = await imgflip.memes()
console.log(memes)

// Caption and download a great meme!
await imgflip.meme(`100777631`, {
  captions: [
    `PROGRAMMERS`,
    `THIS PACKAGE`,
    `IS THIS THE GREATEST PACKAGE EVER?`
  ],
  path: `pigeon.png`
})

npm.io

API

new Imgflip(options)

Returns an Imgflip API object.

options

Type: object

Properties
username

Type: string

Your Imgflip username.

password

Type: string

Your Imgflip password.

Methods

memes()

Returns a Promise<object[]> of the top 100 Imgflip memes.

meme(id, options)

Returns a Promise<string> of the captioned image's URL.

id

Type: string

The Imgflip ID of the image to caption.

options

Type: object

captions

Type: string[]

The array of text to caption the Imgflip image with.

font

Type: 'impact' | 'arial'\ Default: 'impact'

The font family to render the image captions with.

maxFontSize

Type: number\ Default: 50

The maximum font size of the image captions in pixels.

path

Type: string | undefined\ Default: undefined

An optional path to download the captioned image to in addition to returning the image URL.

Contributing

Stars are always welcome!

For bugs and feature requests, please create an issue.

License

MIT © Tomer Aberbach

3.0.0

3 years ago

2.0.0

4 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago