How to use figlet - 10 common examples

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 pankod / next-boilerplate / project-cli / index.ts View on Github external
import * as chalk from 'chalk';
/* import * as clear from 'clear'; */
import * as program from 'commander';
import * as figlet from 'figlet';
import * as inquirer from 'inquirer';

import { classComp } from './src/definitions/class-component';
import { funcComp } from './src/definitions/functional-component';
import { pageComp } from './src/definitions/page-component';

console.clear();

console.log(
	chalk.default(
		figlet.textSync('Pankod CLI Boilerplate')
	)
);

const questions = [
	{
		choices: ['page', 'functional component', 'class component'],
		message: 'What do you want to add?',
		name: 'fileType',
		type: 'list'
	}
];

program
	.command('addFile')
	.alias('a')
	.description('Add a file')
github cloudcomponents / cdk-components / tools / build-tools / src / cli.ts View on Github external
import * as yargs from 'yargs';
import * as chalk from 'chalk';
import * as figlet from 'figlet';

import * as zipLambda from './commands/zip-lambda';
import * as create from './commands/create';

const NAME = 'cloudcomponents';

// eslint-disable-next-line no-console
console.log(chalk.red(figlet.textSync(NAME)), '\n');

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { version } = require('../package.json');

// eslint-disable-next-line no-unused-expressions
yargs
    .version(version)
    .scriptName(NAME)
    .help('help')
    .command(zipLambda)
    .command(create).argv;
github pankod / next-boilerplate / project-cli2 / index.ts View on Github external
import * as chalk from 'chalk';
/* import * as clear from 'clear'; */
import * as program from 'commander';
import * as figlet from 'figlet';
import * as inquirer from 'inquirer';

import { classComp } from './src/definations/class-component';
import { funcComp } from './src/definations/functional-component';
import { pageComp } from './src/definations/page-component';

console.clear();

console.log(
	chalk.default(
		figlet.textSync('Pankod CLI Boilerplate')
	)
);

const questions = [
	{
		choices: ['page', 'functional component', 'class component'],
		message: 'What do you want to add?',
		name: 'fileType',
		type: 'list'
	}
];

program
	.command('addFile')
	.alias('a')
	.description('Add a file')
github SurenAt93 / DevBattle / app.js View on Github external
server.listen(env.port || config.get('port'), _ => {
  figlet.text('connect', (err, data) => {
    if (err) return console.error(err); // TODO ::: Create ErrorHandler
      console.log(data);
    })
});
github gaowhen / gon / bin / proxy.js View on Github external
function spawn() {
	figlet.text('Gon', {
		font: 'univers',
	}, (err, data) => {
		if (err) {
			console.error(err)
			return
		}

		console.log(data)
		console.log('Okay dokey, ready to workโ€ฆ')
	})

  const gulp = path.join(__dirname, '../node_modules/gulp-cli/bin/gulp.js')
  const gulpfile = path.join(__dirname, 'gulpfile.babel.js')

  // --gulpfile  will manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well
  subApp = exec(`${gulp} --color --gulpfile ${gulpfile} --cwd ${CWD}` , (error, stdout) => {
github pjobson / movie2ascii / movie2ascii.node.js View on Github external
const showInfoPage = (deferred) => {
	// { fontlist: true/false, formats: true/false, codecs: true/false }
	if (global.info.fontsample) {
		console.log(`Sample of: ${global.info.fontsample}\n`);
		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 = [];
github deecewan / boilerpl8 / src / index.js View on Github external
import chokidar from 'chokidar';
import http from 'http';
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import env from 'dotenv';
import chalk from 'chalk';
import figlet from 'figlet';
import reporter from './server/lib/webpackReporter';

import { name } from '../package.json';

env.config();

figlet.text(`Welcome to \n ${process.env.APPLICATION_NAME || name}`, {
  verticalLayout: 'full',
  kerning: 'fitted',
}, (err, data) => {
  if (!err) {
    console.log(chalk.green(data));
  }
});

const app = express();
if (process.env.NODE_ENV === 'development') {
  const config = require('../webpack.config.babel.js').default; // eslint-disable-line
  const compiler = webpack(config);

// Serve hot-reloading bundle to client
  app.use(webpackDevMiddleware(compiler, {
    publicPath: config.output.publicPath,
github kitze / gtb / src / index.js View on Github external
{
    name: 'task',
    depends: ['name']
  },
  {
    name: '.'
  },
  {
    name: 'production',
    depends: ['name']
  }
];

/* ====== Initialize ====== */

figlet('GTB', function (err, data) {
  console.log(data.toString());
  gtbConfig = readGtbConfig();
  initialize();
});

function addCliCommands() {
  program
    .option('-n, --name [projectName]', 'option: Run project')
    .option('-t, --task [taskName]', 'option: Run specific gulp task on a project [default]', 'default')
    .option('-p, --production', 'option: Set production mode')
    .option('list', 'command: List all the projects')
    .option('add [add]', 'command: Adds a new project to gtb')
    .option('deploy [deploy]', 'command: Deploys project to surge.sh')
    .option('delete [delete]', 'command: Deletes project')
    .option('.')
    .parse(process.argv);
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 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();
		});
	}

figlet

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

MIT
Latest version published 9 months ago

Package Health Score

79 / 100
Full package analysis