Terminal Tools

Global

Methods

rainbow(message)

Prints a message in rainbow colors

Parameters

  • message String
    The message to print

Example

rainbow("Hello, world!");

Source

async

renderImage(img) → {Promise.<String>}

Returns a console.log-able string of the image

Parameters

  • img Buffer | String
    The image to render, as a Buffer or a file path

Returns

  • Promise.<String> The image, as a string

Example

renderImage("image.png").then(console.log);

Source

async

renderVideo(videoPath) → {Promise.<Array.<String>>}

Convert a video to ASCII

Parameters

  • videoPath String
    The file path to the video

Returns

  • Promise.<Array.<String>> The video, as an array of frames

Example

renderVideo("video.mp4").then(console.log);

Source

rgbToAnsi256(r, g, b) → {number}

Converts RGB to ANSI 256 color

Parameters

  • r number
    Red
  • g number
    Green
  • b number
    Blue

Returns

  • number The ANSI color code

Example

rgbToAnsi256(255, 255, 255);

Source