If you are familiar with most javascript courses, they teach you 'notation' or "notation" for making strings. I am taking Wes Bos' Beginner's Javascript Course and he taught the third option. While at face value there isn't a ton different in your day to day life unless you want to dazzle up your console logs from node.js.
Wes taught me that you can use backticks to create multiline strings that will actually stay multiline in your console. My gears started turning with possibilities. This post is about why I think it's awesome.
Below you can see what I was aiming for. I'm going to teach you how to do something just like this.
First, create a project folder. cd
into that directory run npm init -y
From there add a new file named app.js
you can do this with touch app.js
Inside that file drop the following using your favorite IDE or if you have it set up run code .
which should open up Visual Studio Code editor in that directory. Add the following to your app.js
file.
//SETUP app.listen(3000, () => { console.log( ` ///THIS IS WHERE YOU WILL PUT YOUR ANSCII WORD ART ` ); });
Now, head over to ANSCII Art Generator called TAAG. Put in your input you'd like to use that will display in your node terminal. Bear in mind formatting doesn't hold up well with smaller screens so keep it short.
It should look something like this:
********************************************************** __ __ ____/ /_________ __/ /___ ____ ____ __ ____ / __ / ___/ _ \\ | /| / / / _ \\/ __ / ___// __ \\/ ___/ / /_/ / / / __/ |/ |/ / / __/ /_/ / / / / / (__ ) \\__,_/_/ \\___/|__/|__/_/\\___/\\__,_/_/ /_/ /_/____/ https://DrewLearns.dev | [email protected] ********************************************************* Node/Express Server Started - Now listening on respective Port.
Note: In some characters like
\
you may need to escape first. The double backslashes on some lines I had to add in order to escape those characters which the generator doesn't do for ya. You may need to play around with it a bit to get the proper spacing and add flare with**********
as necessary ?
Now just paste the ANSCII Art you got into line 5 of the app.js and fire that puppy up with node app.js
and show off your load screen flare. Post your's to twitter and tag me @drewlearns
Drew is a seasoned DevOps Engineer with a rich background that spans multiple industries and technologies. With foundational training as a Nuclear Engineer in the US Navy, Drew brings a meticulous approach to operational efficiency and reliability. His expertise lies in cloud migration strategies, CI/CD automation, and Kubernetes orchestration. Known for a keen focus on facts and correctness, Drew is proficient in a range of programming languages including Bash and JavaScript. His diverse experiences, from serving in the military to working in the corporate world, have equipped him with a comprehensive worldview and a knack for creative problem-solving. Drew advocates for streamlined, fact-based approaches in both code and business, making him a reliable authority in the tech industry.