{"id":13682109,"url":"https://github.com/Marak/asciimo","last_synced_at":"2025-04-30T06:33:46.231Z","repository":{"id":952016,"uuid":"733259","full_name":"Marak/asciimo","owner":"Marak","description":"asciimo - create awesome ascii art with javascript! works in the browser or node.js","archived":false,"fork":false,"pushed_at":"2020-07-27T15:16:01.000Z","size":3398,"stargazers_count":285,"open_issues_count":10,"forks_count":34,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T11:19:59.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marak.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-06-22T04:08:49.000Z","updated_at":"2024-09-27T16:42:44.000Z","dependencies_parsed_at":"2022-08-16T11:35:15.921Z","dependency_job_id":null,"html_url":"https://github.com/Marak/asciimo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fasciimo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fasciimo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fasciimo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fasciimo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marak","download_url":"https://codeload.github.com/Marak/asciimo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223961421,"owners_count":17232251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:01:40.881Z","updated_at":"2024-11-12T01:31:03.272Z","avatar_url":"https://github.com/Marak.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ctable\u003e\n  \u003ctr valign = \"middle\"\u003e\n    \u003ctd\u003e\u003cimg src = \"http://imgur.com/kmbjB.png\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\n      \u003ch1\u003egreetings, i am asciimo\u003c/h1\u003e\n      \u003ch1\u003ei create awesome ascii art with javascript!\u003c/h1\u003e\n      \u003ch1\u003ei work in node.js and the browser\u003c/h1\u003e\n    \u003c/td\u003e    \n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cdiv align = \"center\"\u003e\u003cimg src = \"http://i.imgur.com/CDKZc.png\" border = \"0\"/\u003e\u003c/div\u003e\n\n### font files are FIGlet .flf files \u003ca href = \"http://en.wikipedia.org/wiki/FIGlet\"\u003ehttp://en.wikipedia.org/wiki/FIGlet\u003c/a\u003e\n## USAGE\n\n### command-line -\n          asciimo \"roffles\" Cybermedium\n\n### node.js - \n          var asciimo = require('./lib/asciimo').Figlet;\n          var colors = require('./lib/colors'); // add colors for fun\n\n          // pick the font file\n          var font = 'banner';\n          // set text we are writeing to turn into leet ascii art\n          var text = \"hello, i am asciimo\";\n\n          asciimo.write(text, font, function(art){\n            console.log(art.magenta);\n            var anotherFont = 'binary';\n            var moreText = \"i turn text into leet ascii art ^_^.\";\n\n            asciimo.write(moreText, anotherFont, function(art){\n              console.log(art.red);\n              var anotherFont = 'Colossal';\n              var moreText = \"400+ fonts supported\";\n\n              asciimo.write(moreText, anotherFont, function(art){\n                console.log(art.green);  \n                var anotherFont = 'tinker-toy';\n                var moreText = \"Marak Squires 2010\";\n\n                asciimo.write(moreText, anotherFont, function(art){\n                  console.log(art.yellow);  \n                  console.log('if you can\\'t see the text try making your console larger'.red.underline)\n                });\n\n              });\n\n            });\n\n          });\n\n### browser - \n\n          // the current browser demo requires jQuery. you could easily make it work without jQuery.\n          // we'll have to figure out a smarter way to make this library work dual-sided. \n          // also, i haven't included the DOM elements here so you really should just check out the index.html file\n\n          \u003cscript type=\"text/javascript\" src=\"./lib/asciimo.js\"\u003e\u003c/script\u003e\n\n          \u003c!-- fonts.js doesn't contain the fonts, just the font names. fonts are located in /asciimo/fonts/   --\u003e\n          \u003cscript type=\"text/javascript\" src=\"./lib/fonts.js\"\u003e\u003c/script\u003e\n\n          \u003c!-- jquery not required, just use this this demo page --\u003e\n          \u003cscript type=\"text/javascript\" src=\"./lib/jquery.js\"\u003e\u003c/script\u003e\n\n\n          \u003cscript type=\"text/javascript\"\u003e\n\n          // not used, could be implemented, maybe AJAX browser cache is good enough? do some research!\n          var fontCache = {};\n\n          $(document).ready(function(){\n\n            // populate the select box\n            for(var i = 0; i\u003cFiglet.fontList.length; i++){\n              var fontTitle = Figlet.fontList[i].replace('.flf','').replace('.aol',''); // remove the file extentions for the title\n              $('#fontSelector').append('\u003coption value = \"'+Figlet.fontList[i]+'\"\u003e'+fontTitle+'\u003c/option\u003e');\n            }\n    \n            // protip : understanding the following two blocks of code will make you jQuery ninja\n    \n            /***** NAMED EVENTS *****/\n\n              // change the font and load a new font via jQuery async AJAX request\n              $(document).bind('##CHANGE_FONT##', function(e, data){\n                Figlet.loadFont(data.fontName, function(rsp){\n                  $(document).trigger('##RENDER_ASCII_ART##', {font:rsp}); // the font has changed, lets call the render ascii art event\n                });\n              });\n  \n              $(document).bind('##RENDER_ASCII_ART##', function(e){\n                Figlet.write($('#theCode').val(), $('#fontSelector').val(), function(str) {\n                  debug.log('wrote');\n            \t\t  $('#asciiArt').html('\u003cpre\u003e' + str + '\u003c/pre\u003e');\n            \t\t});\n              });\n\n            /**** END NAMED EVENTS ****/\n\n            /**** BIND UI EVENTS ****/\n\n              // select box change\n              $('#fontSelector').change(function(){\n                $(document).trigger('##CHANGE_FONT##', {\"fontName\":$(this).val()})\n              });\n    \n              // you would think jQuery.change() would cover the keypress event on select boxes? \n              $(\"#fontSelector\").keypress(function (){\n                $(document).trigger('##CHANGE_FONT##', {\"fontName\":$(this).val()})\n              });\n\n              // keyup on textarea\n              $('#theCode').keyup(function(e){\n                $(document).trigger('##RENDER_ASCII_ART##');\n              });\n    \n              $('#run').click(function(e){\n                $(document).trigger('##RENDER_ASCII_ART##');\n              });\n\n            /**** END UI BIND EVENTS ****/\n\n            // little bit of a onReady hack. i'll fix the API a bit so this can be done better\n            $(document).trigger('##CHANGE_FONT##', {\"fontName\":'Doh'});\n            $('#fontSelector').val('Doh');\n\n          });\n        \u003c/script\u003e\n\n\n## Authors\n#### Marak Squires, \n#### AWESOME FIGlet parser by \u003ca href = \"http://github.com/scottgonzalez/figlet-js\"\u003eScott Gonzalez\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarak%2Fasciimo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarak%2Fasciimo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarak%2Fasciimo/lists"}