UNPKG

ascii-character-generator

Version:
22 lines (18 loc) 512 B
#!/usr/bin/env node const figlet = require('figlet'); // Get the input text from command line arguments const text = process.argv.slice(2).join(' '); if (!text) { console.error('Please provide some text to convert!'); console.error('Usage: ascii-art "Your text here"'); process.exit(1); } // Generate ASCII art figlet(text, (err, result) => { if (err) { console.error('Something went wrong...'); console.error(err); process.exit(1); } console.log(result); });