JSPM

termeme

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

Create memes directly in your terminal!

Package Exports

  • termeme
  • termeme/index.js

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 (termeme) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Termeme

Create memes directly in your terminal!

When I say create memes directly in your terminal, I mean it! This meme generator will create your meme without ever leaving your terminal. Termeme is a command-line utility, and library, so feel free to customize as much as you want. And don't worry, there's no watermark!

Usage

This CLI/library is available on npm:

npm i --global termeme

No "Graphics Magick", third-party dependencies, or external applications! Plus an easy to use object-based library!

Library

You'll find examples under the examples/ directory, but if you just want to plug-and-play, here's a minimal blank example:

import { TerminalMeme } from "termeme"

const { meme } = await TerminalMeme({
    input: "",
    topText: "",
    bottomText: ""
})

console.log(meme)

Command Line

All options in the library are also available via the CLI. This example shows the examples/basic-wojack-meme.js in CLI form:

termeme --input "layouts/WojackTemplate.jpg" \
--top-text "Generating memes" --bottom-text "It's not in a terminal..." \
--layout "comparison" --save-img "wojackmeme_termeme.jpg" --stroke 4 \
--font-family "Fira Code, Arial" --font-color "#FFFFFF" --stroke-color "#000000" --font-size 0.05

Here's a multi-line example as well for the multicomparison layout:

termeme --input "layouts/SpongebobFiveTemplate.jpg" \
--rows "Intern" "1x Engineer" "5x Engineer" "10x Engineer" "Unemployed" \
--layout "multicomparison" --save-img "spongebob_five_termeme.jpg" --stroke 4 \
--font-family "Fira Code, Arial" --font-color "#FFFFFF" --stroke-color "#000000" --font-size 0.03

Beyond that, here's an all-inclusive list of the available options to customize your dream meme:

Option Description Example
--input Provide the source image for the meme "./layouts/WojackTemplate.jpg"
--topText The text to display at the top of your meme "Generating memes!"
--bottomText The text to display at the bottom of your meme "It's not in a terminal..."
--layout Define which layout you want to use (check the layouts) for available options "comparison"
--saveImg Save the created meme to an image "wojackmeme_Termeme.jpg"
--stroke Add a stroke line to the generated text 4
--fontfamily Specify a font for the text "Fira Code, Arial"
--fontColor Choose a hexedecimal color for the text "#FFFFFF"
--strokeColor Choose a hexadecimal color for the stroke "#000000"
--fontSize Change the font size of the text 0.05
--rows Text for multi-line layouts "One" "Two" "Three" "Four" "Five"

Here's a small test I ran in iTerm2:

Layouts

You can pass in any of these layouts to the layout argument to change how the image is rendered. The main reason for this is to change how the text is rendered onto the image. For example, classic is rendered on top/bottom in the center, while comparison is rendered on top/bottom on the right side of the image as these are some of the more popular types of meme layouts.

Layout Example
classic
comparison
multicomparison

[!NOTE] If your image is blurry or heavily pixelated in the terminal, this is due to the underlying terminal-image library. I plan to eventually look into improved visuals for terminals outside of iTerm2, but don't worry, this does not affect the actual image quality if you export it.