Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
});
}
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;
}
"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)
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();
});
} );
}