How to use the figlet.fontsSync 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 RayzrDev / SharpBot / src / commands / Fun / figlet.js View on Github external
exports.run = (bot, msg, args) => {
    // -l -- List all fonts
    // -f <font> -- Set font
    const parsed = bot.utils.parseArgs(args, ['l', 'f:']);

    if (parsed.options.l) {
        bot.utils.textUpload(figlet.fontsSync().join('\n')).then(({ url }) =&gt; {
            if (!url) {
                return msg.error('Failed to upload fonts list!');
            }

            msg.edit({
                embed: bot.utils.embed('Available Fonts', `A list of available fonts can be found [here](${url}).`)
            }).then(m =&gt; m.delete(5000));
        });
        return;
    }

    if (parsed.leftover.length &lt; 1) {
        throw 'You must provide some text to render!';
    }

    const options = {};</font>
github helixquar / asciidecorator / src / extension.ts View on Github external
function generateFontTest(text): void {
    var figlet = require('figlet');
    var fonts = [];

    figlet.fontsSync().forEach(function (font) {
        fonts.push(font);
    }, this);

    var fontTest = [];

    fonts.forEach(function (font) {
        fontTest.push("Font: " + font);
        fontTest.push("\n");
        
        fontTest.push(
            figlet.textSync(text, {
                font: font,
                horizontalLayout: 'default',
                verticalLayout: 'default'
        }));
github AlexLakatos / ascii-themes / index.js View on Github external
return new Promise((res, rej) => {
      inquirer.prompt([
        {
          type: "input",
          message: "Text:",
          name: "text"
        },
        {
          type: "list",
          message: "Font:",
          name: "font",
          choices: figlet.fontsSync()
        },
        {
          type: "list",
          message: "Theme:",
          name: "theme",
          choices: Object.keys(themes)
        },
        {
          type: "list",
          message: "Horizontal Layout:",
          name: "horizontal",
          choices: ["default", "full", "fitted", "controlled smushing", "universal smushing"]
        },
        {
          type: "list",
          message: "Vertical Layout:",
github helixquar / asciidecorator / src / extension.ts View on Github external
function replaceSelectionWithSelectedFont(): void {
    var figlet = require('figlet');
    var items: QuickPickItem[] = [];

    figlet.fontsSync().forEach(function (font) {
        items.push({ label: font, description: "Use the " + font + " font" });
    }, this);

    Window.showQuickPick(items).then(function (selection) {
        if (!selection) {
            return;
        }
        replaceSelectionsWithFont(selection.label);
    });
}
github skypager / skypager / src / runtimes / node / src / cli.js View on Github external
get font() {
      return sample(require('figlet').fontsSync())
    },
  },

figlet

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

MIT
Latest version published 1 month ago

Package Health Score

85 / 100
Full package analysis