• Stars
    star
    281
  • Rank 147,023 (Top 3 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created over 14 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

asciimo - create awesome ascii art with javascript! works in the browser or node.js

greetings, i am asciimo

i create awesome ascii art with javascript!

i work in node.js and the browser

font files are FIGlet .flf files http://en.wikipedia.org/wiki/FIGlet

USAGE

command-line -

      asciimo "roffles" Cybermedium

node.js -

      var asciimo = require('./lib/asciimo').Figlet;
      var colors = require('./lib/colors'); // add colors for fun

      // pick the font file
      var font = 'banner';
      // set text we are writeing to turn into leet ascii art
      var text = "hello, i am asciimo";

      asciimo.write(text, font, function(art){
        console.log(art.magenta);
        var anotherFont = 'binary';
        var moreText = "i turn text into leet ascii art ^_^.";

        asciimo.write(moreText, anotherFont, function(art){
          console.log(art.red);
          var anotherFont = 'Colossal';
          var moreText = "400+ fonts supported";

          asciimo.write(moreText, anotherFont, function(art){
            console.log(art.green);  
            var anotherFont = 'tinker-toy';
            var moreText = "Marak Squires 2010";

            asciimo.write(moreText, anotherFont, function(art){
              console.log(art.yellow);  
              console.log('if you can\'t see the text try making your console larger'.red.underline)
            });

          });

        });

      });

browser -

      // the current browser demo requires jQuery. you could easily make it work without jQuery.
      // we'll have to figure out a smarter way to make this library work dual-sided. 
      // also, i haven't included the DOM elements here so you really should just check out the index.html file

      <script type="text/javascript" src="./lib/asciimo.js"></script>

      <!-- fonts.js doesn't contain the fonts, just the font names. fonts are located in /asciimo/fonts/   -->
      <script type="text/javascript" src="./lib/fonts.js"></script>

      <!-- jquery not required, just use this this demo page -->
      <script type="text/javascript" src="./lib/jquery.js"></script>


      <script type="text/javascript">

      // not used, could be implemented, maybe AJAX browser cache is good enough? do some research!
      var fontCache = {};

      $(document).ready(function(){

        // populate the select box
        for(var i = 0; i<Figlet.fontList.length; i++){
          var fontTitle = Figlet.fontList[i].replace('.flf','').replace('.aol',''); // remove the file extentions for the title
          $('#fontSelector').append('<option value = "'+Figlet.fontList[i]+'">'+fontTitle+'</option>');
        }

        // protip : understanding the following two blocks of code will make you jQuery ninja

        /***** NAMED EVENTS *****/

          // change the font and load a new font via jQuery async AJAX request
          $(document).bind('##CHANGE_FONT##', function(e, data){
            Figlet.loadFont(data.fontName, function(rsp){
              $(document).trigger('##RENDER_ASCII_ART##', {font:rsp}); // the font has changed, lets call the render ascii art event
            });
          });

          $(document).bind('##RENDER_ASCII_ART##', function(e){
            Figlet.write($('#theCode').val(), $('#fontSelector').val(), function(str) {
              debug.log('wrote');
        		  $('#asciiArt').html('<pre>' + str + '</pre>');
        		});
          });

        /**** END NAMED EVENTS ****/

        /**** BIND UI EVENTS ****/

          // select box change
          $('#fontSelector').change(function(){
            $(document).trigger('##CHANGE_FONT##', {"fontName":$(this).val()})
          });

          // you would think jQuery.change() would cover the keypress event on select boxes? 
          $("#fontSelector").keypress(function (){
            $(document).trigger('##CHANGE_FONT##', {"fontName":$(this).val()})
          });

          // keyup on textarea
          $('#theCode').keyup(function(e){
            $(document).trigger('##RENDER_ASCII_ART##');
          });

          $('#run').click(function(e){
            $(document).trigger('##RENDER_ASCII_ART##');
          });

        /**** END UI BIND EVENTS ****/

        // little bit of a onReady hack. i'll fix the API a bit so this can be done better
        $(document).trigger('##CHANGE_FONT##', {"fontName":'Doh'});
        $('#fontSelector').val('Doh');

      });
    </script>

Authors

Marak Squires,

AWESOME FIGlet parser by Scott Gonzalez

More Repositories

1

colors.js

get colors in your node.js console
JavaScript
5,152
star
2

faker.js

What really happened with Aaron Swartz?
1,522
star
3

say.js

TTS (text to speech) for node.js. send text from node.js to your speakers.
JavaScript
1,476
star
4

pdf.js

Project Deprecated
JavaScript
399
star
5

node_mailer

## Project deprecated, see README
JavaScript
388
star
6

translate.js

translate text from one language to another on node.js and the browser. 30+ languages supported, simple as cake.
JavaScript
309
star
7

webservice.js

## Project deprecated, Use flatiron/restful instead
JavaScript
253
star
8

JSONloops

JSONloops is a real-time, multiuser audio sequencer for node.js and the browser.
JavaScript
184
star
9

bpipe

Browser <==> Unix Pipes
JavaScript
159
star
10

play.js

play sound files from node.js to your speakers, simple as cake and kid approved!
JavaScript
159
star
11

buddypond

Cloud OS and Instant Messenger
JavaScript
148
star
12

natman

Forwards external public ports to internal ports without router access.
JavaScript
138
star
13

cron-editor

Visual Cron Editor - Edit and Create Cron Jobs With Ease
JavaScript
138
star
14

HTML

HTML is The BEST JavaScript templating language EVER
JavaScript
99
star
15

session.js

super simple session middleware for node.js, even has optional "magic" sessions which monkey patch the httpServer with one line!
JavaScript
95
star
16

JSLINQ

Clean and simple port of Microsoft's LINQ to node.js (and the browser)
JavaScript
92
star
17

zztmmo

a zzt based massive multiplayer online game built in node.js and jQuery
JavaScript
68
star
18

The-Git-Rap

WORLD PREMIER EXCLUSIVE GIT RAP BROUGHT TO YOU BY GITHUB
64
star
19

node_hash

a super simple hashing library for node.js
JavaScript
58
star
20

roles.js

a super simple node.js JSON based roles management system
JavaScript
58
star
21

zalgo.js

ĭ̱͓̝̭̱͓̃̅͊ͬͫ̏̅ ̣͙̥̥̺͎̱̻̗̘͖́͆̎ͭ͛̊̔̽̂ͭ̽͊ͅa͎̬̣̺͉̼̬̭͚̝͖͕͇̠̥̬͍̥̪̬̪͓͇̬͓̲̹͈̼͚̥̜̙̩̠̤̖̖̫͔̭͍̘̰̳̥͖͚̱͙̻ͯ̓͗̈̌̿̾̈̐̓͗͑̃̔̿̄̚m͙͍͔̙̪͓̩͚̣͙̘̟̞͙͍̺͕̜̻̯͇͉͇̠̙̬͉̖̞̫͇͍̹̖̝̣ͫ͑̈ͥ̀̑͊͆̿ ̬̰̮͉̭̬͙̫̙͖̪̮͎͎͕͉̠̜̦͍̹̦̥̳̙̬̺̲͙͈̹̹̠̘͔̙ͨ̇͊̉͂͆ͬͯ̄̃ͪͅz͓͇̱̝̭̜̫̞͚͉̭̫̞͇̮̟̫̗̼̟͐ͦ͗̈̀͌͒̽̆ͧͭ̈͂̾̇̃̂ͅa̹̜̭͔͇̬͍̟̤͈̙̯͍͕͈͇̱̞͖̼̥̺͉̍̑̒̎l͙̙̼̰̩̟̗̙̝̜̙̺̖͍̜̞̤̞͔͖̞̘̣͍̖̰̙͔̖̳̼͐̓̾̇̑ͤ͆̈̎̔̇̃̐͒g͔̦͖̞̯͙̠̭̫̜͈̺̮̠̜̻̱̥̙ͦͧ̉͆̊̎̐ͅo͍̥̹̮͔̣̮̜̱̫̼͚̘̮̝̰̣̼͕͉͕͖̼̫͓̠̣͖̼̦͍͍̟̗̤̖̤̞̞͇̠̟̥̻͎̩̠̭̲̞͇͙̦̣̬͉̱̳͙̫̫͈̻̊̓ͫ̈ͅͅ,̼̦͓̤̘̦͖͈̜̭̩̯̹͈̭̜̙̞̿͊ͩ̄̐ͨ͐̈̎̒̉̆̍ͪ̀̿̍̌̚ ̞̳͉̮̯̱͉̜̰̜͔͈͓̹̻̭͔̖̟͓̭̜͎̰̹̪̭̖͇̟̗͕̠̞̳̤̯͕̠̳̙̘͛ͫ̅̓̿ͥ̓d͎͖̲̝̲̩̹̲̬̪̖̦̯͖̩̤̫͎̠̖͚̘̋͂̉̑̍͒̎ͅe̟͔͍̺͔̖͕̺̰̯͎̞̥̠͙̮͚̪̝͇̱̺̗̻̫̝͚͍͉̪͚̫͚͓͓̩̘͖͎̣̞̹͍ͯ̋̾ͪͮ́s̬͎͍̻͍̹̘̣͕̰͍͔̱̯̜̰̹̥̐̇̆͊ͯ̈ͮ̇̍̎̆ͥ̆̌̍̋̈̽̍ͅt͖̩̺̫̘̰̬̝̙̰̱̦̹͓̦͍̩͖̤̩͉̭̳̲̬̘̮̥̠̤̺͇͈̩̺̞̗̰̘͚̯̦̺̤̥̞̞̻̯̳͙͕̹̜̩͔̫̺̖͍̺́͋ͫ̿ͨ̿ͩ̀͊͌͐͛̂̊̄ͅͅr͎̺͕̟̦̩̙̯͓͈̪̜̤͎͔̯͕̫͉͇͓͔̘̪̝̤̩̣̺̮͉̘̠̠̣̟̮͚̠̘̹͓̥͉͖͓̞͍͖̼̯̤̦̟͔̦̖͔͙̝̫͓͉̖̳̞̅͐ͩ̔̄ͯ͌́̋̒ͧ̽͆̀o̮̳̞̭̪̣͙̰̭̱̺̬̻͙̰̰̣̪̩̱̫̱̞̣͇̭̫̺̙̹͓̭͕̮͕̞̦̗̾͒̉̍̌ͯý͖̖̗̲̥͉̹͚̝̫̟͕̭͖͉͍͇͎͓̣̭̗̤̩͖̼̪͙̣̖̣͓̮̯̤̙͇͖̠̮̦̭̙̝͖̦̞̠̩̺̼̱̱̦̤̥̮̲̻̬̱̋ͪ̓́̒͆̓ͥ͋̓̉̎ͣ̇̍̚ͅe̬͙̱̬͕͚̞̯͎̻̟̙̪̙̝̥̣̫̲̮̖̪ͬͣͭ̉̾ͪ̐ͫ͒̈ͅr̭͓̥̯̘̗̮͍͓̰̦̬͈̖̖̟̹̥̼͙͔̭̪̩͉̠̠̬̜̺̞̘̳̭͔̥̗̱̠͕̠͉̳̻̫̖̘̬̺͍̠͔͙̻̮͉̩̲͈̳̞̊͑͒̿̃̊̉͌̂ͧ̃ͨͬ̅̿ͅͅͅͅͅ ̬̺͚̤͎͓̦̻̻̠͙͎̬̣͖̹͕̫̭̝̗̞͖̣̥̯͉͚̮̗̩̭͛ͭͭ̽ͥ͐͐͆͌ͅo̹̦͈̭̰̬̲̣͓̩͓̖̟͓̼͓̬̾́ͪͬ́ͯ̉̃̒ͫ̌̔ͣ̊ͤ̀ͅf͙̱͚͙̰̳̞̹̠̭̲̮̰͍̼̦̯̳̮͚̝͍̙̻͒ͥ́̐̄͑ͣ ̞̹̮̹̹̲̻̝ͫͫ̓̒̚ẉ̹̘̲̗̟̯͖̲͈͕̮͍̯̟͚̩͖͚̖̭̗͛̔̏̇͆̈̃ͤ̎̎͊ͅe̮͈͔̱͇̩̗͖͕͙̯͎̮̬͈̤͕̣̺̼̰͉̗̙̹̦̤̋̐͐͊̔͋̇b̳̝̱͖̥̘͙͈̻̯̰͕̪̜̻͓̩̙̻̭̗̝̲̘̼̰̘̗̳̪͓̠̗͈͕̰͚̣̱̖̼̺̬̯̻̞͙͈̜̖̪͓̣͎̮͑ͤ̈ͯͩͧͯ̍̍ͯ̉͗̎̎͌̿̌͌s̲͉̦̠̣̺̬͇͙̥̪̖̼͉͉ͣ̃̌͋̀ͮ͗̊̉͂͑̿̑͂̄i̱̪̣̪̭̖̙͔̥͚̳͙̻̪̺̲̞͖̻̠͓̻̹̖͔͔̲̣̤̘̪̩̬͇͉͎̰͕̫̭͓̿͐́̈ͦ̊ͮ̉͌ͨ̏ͨͩ̿̆t͖͙͉͎͓̩̻͖͍͚͓͇̞̲̤͚̳͓̪̟̙̗͕͔̦̫̗͍͔̦͇̪͕͉͙̦̬̐͌͊ͮͅe̝̫̤̠͎͇̟̟͔͓̻̤̼͚̥̤̗̘̰͚̘̪͉̻̥͓̟̘̘̹̼̲̲͚̝̯̱͍͍̜͈̪͕̟̝͕͖̝͕̰̣͙̺͎̜͇̜͕͇̗̘ͥͮͥ̌̉̾ͯ͗ͅͅͅͅs͔̯̗̩͔̪̼̲̫̼͙̼̰̟̥͙̠͕̳̣̯͔̮̥̝̠̤̝͍̤͉͚̖̯͖̰̱̹̜̞͈̭̞͖̓͊́̾̍̑͐ͩͅͅ
JavaScript
55
star
22

javascript-fu

a javascript martial arts library for node.js and the browser. destroy the bad parts with ninja-like precision
JavaScript
50
star
23

ANSIdom

a DOM implementation in ANSI escape codes, render HTML to your terminal
JavaScript
37
star
24

node-raps

a community based rap project to teach and promote node.js
36
star
25

xp

agile programming tools in Coffeescript
CoffeeScript
32
star
26

ohh

share content, have fun, make friends
JavaScript
29
star
27

wizard

experimental configuration wizard that transforms json and json-schemas into user-experiences
JavaScript
25
star
28

ayyo-wars

An open and hackable 2D space battle game
JavaScript
24
star
29

hellonode

( used for testing ) a sample node.js application with a well-formed package.json that has contains required fields for nodejitsu deployment
JavaScript
19
star
30

node-kiwf

kill it with fire, in-process node.js process kill-switch, forces node processes to crash based on certain restrictions like memory usage or uptime
JavaScript
18
star
31

machine.js

turn css selectors into state machines
JavaScript
17
star
32

station

a real-time web i/o reporting application built with hook.io
JavaScript
17
star
33

css_to_json

converts .css files into nested json structures ( json-stylesheets )
JavaScript
16
star
34

the-monolith-versus-the-microservice

a tale of two applications. one built as a monolith. the same built with microservices
JavaScript
15
star
35

vinyl-http

push and receive streams of vinyl over http
JavaScript
11
star
36

prototype-hooks

add before and after hooks to any JavaScript prototype chain
JavaScript
10
star
37

mybuddy

JavaScript
10
star
38

data-behaviors

open-source uber unobtrusive behavior (widget) library built with jQuery. uses HTML5's data-attributes, but still works in IE6
JavaScript
10
star
39

node-backbone-request

A syncing engine for server-side backbone.js built on the request library
JavaScript
10
star
40

node-stats

various tools for crunching node.js community data. mostly incomplete.
JavaScript
7
star
41

vinyl-diff

Perform diffs of vinyl file streams
JavaScript
5
star
42

tracker.js

JavaScript
5
star
43

analog-tv-simulation

simulated analog tv presentation for speakeasy js oct 16 2020
JavaScript
5
star
44

Internet_Money

5
star
45

ePlaying-cards

Software and hardware project for e-paper based playing card deck.
Python
4
star
46

senpai

a digital protege for maintaining your open source empire
JavaScript
4
star
47

microtail

HTTP microservice for easily and safely mapping Unix `tail` commands on your server to authenticated public URLs.
JavaScript
3
star
48

badproject

( used for testing ) an example of a malformed node.js package.json
JavaScript
3
star
49

resourceful-coder

Converts Resourceful resources back into the JavaScript code which created them. Not something you probably need.
JavaScript
3
star
50

command-line-signups

JavaScript
3
star
51

resource-builder

UNRELEASED - simple UI for building Resourceful resources
JavaScript
3
star
52

SupremeJSONCompressor

The Supreme JSON Compressor™ is the world's best JSON Compressor / Decompressor.
JavaScript
3
star
53

buddypond-assets

2
star
54

marak.github.io

JavaScript
2
star
55

badjitsu

( used for testing ) an example of a node.js package.json which is missing required fields for nodejitsu deployment.
JavaScript
2
star
56

marak.com-legacy

website for marak.com
JavaScript
2
star