npm.io
4.0.1 • Published 6 years ago

retrotext

Licence
ISC
Version
4.0.1
Deps
3
Size
15 kB
Vulns
0
Weekly
0

Retro Text

NPM version NPM downloads Build status Dependencies

Generate retro style text images using the PhotoFunia API

Installation

The package is on the NPM registry as retrotext. Simply install it with your NPM client of choice.

Compatibility

This module can be used in both the browser and Node.js. It targets ES2015 and newer.

Usage

First, import the module:

const RetroText = require('retrotext')
const { TextStyle, BackgroundStyle } = RetroText

RetroText is an ES6 class that can be manipulated to generate Retro Text images.

Example
// Import the module
const RetroText = require('retrotext')
const { TextStyle, BackgroundStyle } = RetroText

// Set options
const text = new RetroText()
  .setLine1('Top')
  .setLine2('Middle')
  .setLine3('Bottom')
  .setBackgroundStyle(BackgroundStyle.PALM_CIRCLE)
  .setTextStyle(TextStyle.CHROME)

// Generate using API
let URL = await text.fetchURL()
let buffer = await text.fetchBuffer()