retrotext
v4.0.1
Published
API Bindings for the Retro Text Generator
Downloads
95
Readme
📼 Retro Text
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()