2

I'm trying to insert this ascii img:

                              :hNMMh.             
                             .sosooNm`            
                             +sosysyds            
                             s+o/oossy:           
              `.`  -+shho++soy+oo+osyoy:::...`    
     `o:`  `+yhhhoyhhyds/-:-os++oshhsos+/+////+/: 
      oyo//yyyyyyyyhhyhyyssoyymmNmyo///+oosyyyhhd-
      /+shhhhhddhdmhyyyyyyyyyyyyyyysyhhhyyyyyyyyho
     :o+//////+osddyyyyyyyyyyyyyyyyyyyhdhyyyyyyyyd
    `:`          -mhyyyyyyyyyyyyyyhhdmdddhyyyyyyhN
                 ydyyyyyyyyhhhhddmmmdmmddhhyyyyhdm
                 :dhyhyysyhyyyyhhyyhddmdhysyyhyhyd
    .-:-`         :dhyyyyyyhyyyhyyyyyssdhysyyddyyy
  .//::///-`       :dyyyyyyyyyd+://::+:+hdhhhdhyh/
 :/----:::///-.`    +hy+yyysssh::+::/+/sdhyyyyyyh`
-/---------::////:-.-h+://+///y+/+soooddhyyhhyyh- 
o-----------------://dy+:-:+syyd/+hso+hhhhhhyso-  
+::///:::::::::--::::sdhyshhyyyyh:/ssso/s++y`     
       ```.o/://://///mhyhddhyyyhs--//://-+:      
           `o--:::::::ydyyymdhyyyd:-:://--o       
            /:--------:dyyhsydhyyhs-:/:--+`       
             +:-------:syyd:-odhyyd/:--:+`        
        `.    :/:--:/::-dhhhyo+dhyhs:-//`         
         ++:.`  ....:/--odyyym::mhyhhys           
          ///:::::::++///d//sh--ydyyyyh+          
           -+---------:::+s-:s-:+hhyhy/y          
            `//--------:::h:+o:-  :sos-y          
              .:/-----:/+sy/s-      /o-o:         
                 ------++/-:++       .s/s`        
                    /yyo+/:-          `y:o/       
                     ``                -s-:o-     
                                        s:-:+o.   
                                        .so++//    

In a variable to log it in the terminal, but I can't close the " or '. any idea?

Piero
  • 9,173
  • 18
  • 90
  • 160

2 Answers2

0

There are many ways to achieve this, but in my opinion the best one is to store this text in a file (image.txt for example), and read it with the fs module like this

var image = fs.readfilesync('image.txt');
console.log(image);
Omri Luzon
  • 3,975
  • 6
  • 20
  • 29
0
  1. First of all use literals `` or readFile for keeping new lines and spaces.
  2. Make sure that your terminal use monotype font, because you need the same width for every character.
h0x91B
  • 1,211
  • 15
  • 19