How to use the figlet.fonts function in figlet

To help you get started, we’ve selected a few figlet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pjobson / movie2ascii / movie2ascii.node.js View on Github external
figlet.text(global.info.fontsample , {
			font: global.info.fontsample
		}, (err, data) => {
			if (err) {
				console.log(err);
				deferred.reject(err);
			} else {
				console.log(data);
				return deferred.resolve();
			}
		});
	}
	// List of Figlet Fonts
	if (global.info.fontlist) {
		console.log('Available fonts:');
		figlet.fonts((err, fonts) => {
			let fout = [];

			fonts.forEach( (font, idx) => {
				if (idx%6 === 0) {
					fout.push([]);
				}
				fout[fout.length-1].push(font);
			});

			console.log(columnify(fout, {
				showHeaders: false
			}));

			return deferred.resolve();
		});
	}
github dwicao / naturia-bot / commands / fun / typing.js View on Github external
new Promise((resolve, reject) => {
    figlet.fonts((err, fonts) => {
      if (err) {
        console.log("Something went wrong...");
        console.dir(err);
        return;
      }

      const font = fonts[getRandomInt(0, fonts.length)];
      const words = randomWords({ exactly: 1, wordsPerString: 2 })[0];

      figlet(words, { font }, (err2, data) => {
        if (err2) {
          console.log("Something went wrong...");
          console.dir(err2);
          return;
        }
github bsorrentino / maven-confluence-plugin / dist / logo.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Rx = require("rx");
var figlet = require('figlet');
var rxFonts = Rx.Observable.fromNodeCallback(figlet.fonts);
var rxFiglet = Rx.Observable.fromNodeCallback(figlet);
function rxMetadata(font) {
    return Rx.Observable.create(function (subscriber) {
        figlet.metadata('Standard', function (err, options, headerComment) {
            if (err) {
                subscriber.onError(err);
                return;
            }
            subscriber.onNext({ font: font, options: options, headerComment: headerComment });
            subscriber.onCompleted();
        });
    });
}
var VALUE = 'Confluence\n     CLI';
function rxShowFont(font) {
    return rxMetadata(font)
github bsorrentino / maven-confluence-plugin / ts / logo.ts View on Github external
interface Figlet {
    ( input:string, font:string, callback:(err:any, res:string) => void  ):void;

    fonts( callback:(err:any, res:Array) => void ):void;
    metadata( type:string, callback:(err:any, options:any, headerComment:string) =>void ):void
}

const figlet:Figlet = require('figlet');

interface FigletMetadata {
    font:string
    options:any,
    headerComment:string;
}

let rxFonts = Rx.Observable.fromNodeCallback( figlet.fonts );

let rxFiglet =  Rx.Observable.fromNodeCallback( figlet );

function rxMetadata( font:string ):Rx.Observable {
    return  Rx.Observable.create( (subscriber) => {
        figlet.metadata('Standard', function(err, options, headerComment) {
            if (err) {
                subscriber.onError(err);
                return;
            }

            subscriber.onNext( { font:font, options:options, headerComment:headerComment });
            subscriber.onCompleted();
        });
    } );
}

figlet

Creates ASCII Art from text. A full implementation of the FIGfont spec.

MIT
Latest version published 6 months ago

Package Health Score

76 / 100
Full package analysis