I created a Command Line Game for you // 5-Minute Node.js CLI Project

  Рет қаралды 485,101

Fireship

Fireship

2 жыл бұрын

Building your own Command Line Interface (CLI) is easier than you might think with Node.js. There are a bunch of open-source packages that can handle colors, animation, and user input with ease. Use them to build a CLI game from scratch using only JavaScript.
To play my CLI game, run "npx firequiz" from your terminal.
#javascript #programming #game
🔗 Resources
Chalk github.com/chalk/chalk
Inquirer github.com/SBoudrias/Inquirer...
Colors.js Controversy www.theverge.com/2022/1/9/228...
Source Code github.com/fireship-io/javasc...
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Build a Command Line Interface Node.js
- Top 5 packages for Node.js command line
- Building a terminal game
- Bash vs Node.js
- How to deploy an NPX script
- How to use ESM modules

Пікірлер: 714
@vigovlugt
@vigovlugt 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool
@Kat21
@Kat21 2 жыл бұрын
Good job, that was fast
@pratyushgupta319
@pratyushgupta319 2 жыл бұрын
Awesome
@Pixel__Man
@Pixel__Man 2 жыл бұрын
Well played
@networkable6476
@networkable6476 2 жыл бұрын
damn too late
@soulninjadev
@soulninjadev 2 жыл бұрын
ahhh
@mykalimba
@mykalimba 2 жыл бұрын
Programming isn't about what you know; it's about how fast you can clone the repo and cheat the contest by peeking the source code.
@parzh
@parzh 2 жыл бұрын
TBH, thinking outside of the box is a good skill for a programmer too
@codexed-i
@codexed-i 2 жыл бұрын
UR INSANE GUY
@voicchat
@voicchat 2 жыл бұрын
Or just unpgk
@mhmd_old7
@mhmd_old7 2 жыл бұрын
copied?
@ryanfmatos
@ryanfmatos 2 жыл бұрын
@@parzh thinking outside of the box is just the way you manipulate the cloned repo source code to build your own
@ALXG
@ALXG 2 жыл бұрын
Programming isn't about what you know; it's about how fast you stackoverflow
@HypnosisBear
@HypnosisBear 2 жыл бұрын
Bruh!
@stolensentience
@stolensentience 2 жыл бұрын
Bars
@patsagorn
@patsagorn 2 жыл бұрын
foo!
@doge7831
@doge7831 2 жыл бұрын
@@patsagorn bar
@Dnavashen
@Dnavashen 2 жыл бұрын
lol well said
@robhartle1849
@robhartle1849 2 жыл бұрын
Fireship: NEVER fails to fulfill a promise. ❤️
@Vicer_Exciser
@Vicer_Exciser 2 жыл бұрын
As long as you don’t mind awaiting it
@avetisdn7849
@avetisdn7849 2 жыл бұрын
Yeah. Or like "never reject to resolve a promise"
@islamibrahim8121
@islamibrahim8121 2 жыл бұрын
Haha, glad others found the joke here.
@Zeeye
@Zeeye 2 жыл бұрын
Even async ones
@rishabkoul6222
@rishabkoul6222 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool You literally made me upgrade my node js to do this
@rishabkoul6222
@rishabkoul6222 2 жыл бұрын
@Nimstad guess I was not smart enough 😅
@russianyoutube
@russianyoutube 2 жыл бұрын
Lmao
@Jubinmail
@Jubinmail Жыл бұрын
Make sure all your other projects are working
@christianpayne522
@christianpayne522 2 жыл бұрын
The only reason I got all questions right the first time was because I watch this channel. Keep up the good work Jeff!
@Mr.Andrew.
@Mr.Andrew. 2 жыл бұрын
One of the coolest parts of watching you over the past couple of years is seeing your progress. Amazing really!
@hjxb
@hjxb 2 жыл бұрын
i like this one a lot! the lesson was bite-sized and has an easy-access interactive game. you've obviously been putting a lot of thought into these latest videos!
@RedCrafter07
@RedCrafter07 2 жыл бұрын
This is the most useful tutorial I've seen for this topic! Thank you so so much for your work!
@EdgeGaming
@EdgeGaming 2 жыл бұрын
This is really cool! I followed along to make a little smart contract invocation tool, my first console app. Works a charm and looks awesome thanks to you!
@Bell_420
@Bell_420 4 ай бұрын
2 min in and I learned like 5 things a 5 hour tutorial didn't tell me, 2 more min in and ive leraned 5 more things. Love this channle
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis 2 жыл бұрын
Oi! My packages aren't useless! Stellar job as usual Jeff, your videos are always a joy.
@juleswinnfield1437
@juleswinnfield1437 Жыл бұрын
I love this video - I'm new to JS and seeing you break down all these useful packages is super cool! Thanks :)
@marwan.v1511
@marwan.v1511 2 жыл бұрын
First of all, that was a super cool and amazing video. second, you just gave me an idea that I'm going to do right now. BEST Channel, keep it up
@igordasunddas3377
@igordasunddas3377 Жыл бұрын
I actually have encountered so many useful videos from you, that I decided to subscribe. Thank you, sir.
@wowkster
@wowkster 2 жыл бұрын
Another great video as always. Really looking forward to the full Prisma tutorial
@atalocke
@atalocke 2 жыл бұрын
Every video of yours I watch makes me want to replicate all the cool JS libraries you show in the languages I know.
@masnwilliams
@masnwilliams 2 жыл бұрын
You are pumping out content. Love it!
@felipeventura6176
@felipeventura6176 Жыл бұрын
I had the idea to build a small cli game using node for a role I'm applying, this helped me immensely, thanks!
@BenedictGS
@BenedictGS 2 жыл бұрын
The amount of content you are posting, i am liking it.
@mayanxoni
@mayanxoni 2 жыл бұрын
This video was awaited asynchronously!
@CleverProgrammer
@CleverProgrammer 2 жыл бұрын
YOOOO THIS VIDEO IS SICK!!! I was looking to build my own command line tool. Thank you!!!
@iamthehimansh2980
@iamthehimansh2980 2 жыл бұрын
I am Your Subscriber too Bro. I am From India.
@Just_Moh_it
@Just_Moh_it 2 жыл бұрын
@@iamthehimansh2980 Ok
@obiaboimmanuel8729
@obiaboimmanuel8729 2 жыл бұрын
wow i was shocked seeing you used node for this, this is really awesome
@hannad
@hannad Жыл бұрын
Imagine building all of it without any packages. That would be a nice and informative video to watch.
@maximood-tired
@maximood-tired 2 жыл бұрын
thank you bro this is exactly what i need right now
@gjaynir0508
@gjaynir0508 2 жыл бұрын
Much awaited topic. Thank you sir.
@axelsomerseth
@axelsomerseth Жыл бұрын
Great tutorial! Straight to the point!
@morrisonak
@morrisonak 2 жыл бұрын
Awsome video. I cant wait to build something.
@msdhaliwal
@msdhaliwal 2 жыл бұрын
Had my PC open to repo of CLI tool our company ships, need to rewrite the whole and this video pops up on my feed. awesome 😎. thanks for great content.
@NNNedlog
@NNNedlog 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool. Though I'm late, but this quiz is really nice. I love your videos and they have been helping me with motivation to code. Thanks Fireship
@usama57926
@usama57926 2 жыл бұрын
Your sense of humor is amazing...
@salarhashemian3436
@salarhashemian3436 2 жыл бұрын
I learned alot of things, thanks man!
@andrzejkulakowski
@andrzejkulakowski 2 жыл бұрын
It's amazing how colors speak to me even in CLI :D
@pcgs_
@pcgs_ 4 ай бұрын
Nice tutorial, thank you.
@MattMcT
@MattMcT 2 жыл бұрын
Is it just me or does this video get BETTER each time?
@lauralegerofficial
@lauralegerofficial 2 жыл бұрын
Another video from my favorite KZfaqr. Your videos have helped me so much, thank you Fireship.
@lauralegerofficial
@lauralegerofficial 2 жыл бұрын
I can't believe I got noticed by Fireship! Also somehow when I edited this comment I lost the little highlight from fireship.
@Sortexx
@Sortexx 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool
@xinaesthetic
@xinaesthetic 2 жыл бұрын
@@lauralegerofficial I guess it's possible that KZfaq automatically removes the heart if you edit the comment. I imagine a lot of people would abuse it otherwise.
@amir3515
@amir3515 2 жыл бұрын
@@lauralegerofficial lol get rekt
@Dealman15
@Dealman15 2 жыл бұрын
Any update on when you'll be covering Lua? I saw somewhere it's on your to-do list, it's the language that first got me into programming so am quite excited for that one! :D
@rtemis9016
@rtemis9016 2 жыл бұрын
This is awesome Jeff!!
@ab.3800
@ab.3800 2 жыл бұрын
I did stuff like this learning perl but with the actual terminal escape codes, that was a fun exercise lol
@edwardblewitt1961
@edwardblewitt1961 2 жыл бұрын
This guys videos are so good atm!
@cineverseproductions
@cineverseproductions 2 жыл бұрын
bruh, you have a strong command on programming. Great work again. 👍
@shantanusharma4901
@shantanusharma4901 2 жыл бұрын
Very good sir, you are JavaScript expert
@stan7816
@stan7816 2 жыл бұрын
I know java script just about as well as I know Chinese and I couldn't tell you a single Chinese word to save my life. This video was a mostly irrelevant autoplay, yet I watched the entire video. Watched partially because I've always been fascinated by the seemingly limitless potential of code but also because I was genuinely impressed by the presentation.
@rida4002
@rida4002 2 жыл бұрын
It freaking amazing to have your bug in the news.
@SoreBrain
@SoreBrain 2 жыл бұрын
BRUH THIS CONTENT IS SO GOOD
@DrNabeel20
@DrNabeel20 2 жыл бұрын
Super useful :)
@ifstatementifstatement2704
@ifstatementifstatement2704 2 жыл бұрын
I remember when I created my first cli at 12 yrs old, 25 years ago. Had no internet, no tutorial. Just wanted to make an rpg with what I knew of programming at the time.
@shubhampatel6908
@shubhampatel6908 2 жыл бұрын
As always, learnt a lot in a very short time, Thanks
@zathkal4004
@zathkal4004 2 жыл бұрын
Dude you're a coding beast on a another level in terms of your creativity, content and short & sweet presentations without having showing your face as yet
@ararune3734
@ararune3734 2 жыл бұрын
Watch KZfaq tutorials, find problems then google solutions until you lose your mind and you go to sleep, you wake up and you have an incredibly simple solution in mind that you somehow missed staring at the screen for hours. Coding is mostly just staring at the screen wondering why it doesn't work, the rest of it is starting at the screen wondering why it does work.
@lord-sive
@lord-sive 2 жыл бұрын
Programming isn't about what you know; it's about improving technology
@maxelartist4264
@maxelartist4264 Жыл бұрын
cool, i am learning js and it is a good example to learn how works promise
@adam-the-dev
@adam-the-dev 2 жыл бұрын
By the way, the built-in "util" dependency lets you "promisify" callback functions. const sleep = require("util").promisify(setTimeout); ... await sleep(2000);
@TheJobCompany
@TheJobCompany 2 жыл бұрын
also left-pad left pads a string, btw
@FC-ei6kw
@FC-ei6kw 2 жыл бұрын
Better to use the setTimeout function from timers/promises.
@yuzuru1848
@yuzuru1848 2 жыл бұрын
you cannot use top-level-await outside modules import { setTimeout as sleep } from "timers/promises" await sleep(2000)
@HuntingKingYT
@HuntingKingYT 2 жыл бұрын
Hmm, but you still don't have a built-in promise-like sleep function, you still need to declare it...
@DaCurse0
@DaCurse0 2 жыл бұрын
@@HuntingKingYT It is built-in, just not global.
@yorgosdimitriadis3874
@yorgosdimitriadis3874 Жыл бұрын
Also, it would be interesting to see short video about cli theme engines, like oh my posh and so forth
@toddy5153
@toddy5153 2 жыл бұрын
Good project. Observation: minute 3:03, use setTimeout(ms), from 'timers/promises'.
@shine.m202
@shine.m202 2 жыл бұрын
Thank you!
@SperkSan
@SperkSan 2 жыл бұрын
awesome video i used chalk all the time but didn't know there was a package for gradient
@joakimrosenfeldt9530
@joakimrosenfeldt9530 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool And it's absolutely true
@qwoolrat
@qwoolrat 2 жыл бұрын
thank you for putting the sourcecode out so i wouldn't have to download node to run it, Programming isn't about what you know; it's about making the command line look cool
@TheBaldr
@TheBaldr 2 жыл бұрын
Legend of the Red Dragon was one of the best command line/BBS door games ever made.
@farhadbagheri5687
@farhadbagheri5687 2 жыл бұрын
U R best programming channel in youtube
@mzpl7357
@mzpl7357 2 жыл бұрын
I was looking for lists like the ones you can create with 'Inquirer'. Thank you.
@AmitKumarKhare
@AmitKumarKhare 2 жыл бұрын
Thank you, Jeff. :)
@AlexanderJohnLee
@AlexanderJohnLee 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool!
@craftoverflow
@craftoverflow 2 жыл бұрын
so good!
@bhavishyachandra
@bhavishyachandra 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool 💯
@burgerbuns4070
@burgerbuns4070 Жыл бұрын
Programming isn't about what you know; it's about making the command line look cool 🔥🔥🔥
@daniel7007
@daniel7007 Жыл бұрын
Awesome!
@jacksaxby4072
@jacksaxby4072 2 жыл бұрын
Programming isn’t about what you know; it’s about making the command line look cool
@victortruong2538
@victortruong2538 7 ай бұрын
2:11 the "Hi mom" hurts a lot now. Take care fireship we are very proud of you.
@Ardens.
@Ardens. 2 жыл бұрын
What do you use to screen record? The resolution is so crisp!
@Lostpanda123
@Lostpanda123 2 жыл бұрын
So cool!
@NNNedlog
@NNNedlog 2 жыл бұрын
I'm gonna try this
@dan_le_brown
@dan_le_brown 2 жыл бұрын
Jeff! I love your videos 😭
@mrashad_com
@mrashad_com 2 жыл бұрын
In just 6:24 min. you explained too much useful tools/libs, thank you very much
@miraclehesed8959
@miraclehesed8959 Ай бұрын
This is crazy. I just simply built this using FP with Python, then proceed to build it with OOP and this just got recommended? Crazy.
@KevinChromik
@KevinChromik 2 жыл бұрын
Finished the Quiz 🎊
@CoryTheSimmons
@CoryTheSimmons 2 жыл бұрын
Thank ya!
@zeriaxdev
@zeriaxdev 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool I might be late, but I'm proud I made it to the end :)
@YESHTOFU
@YESHTOFU 2 жыл бұрын
Had fun :)
@barungh
@barungh 2 жыл бұрын
"the one thing that makes developer different than the common people out there is the command line" - thanks for saying this 😎
@quentindrappier7609
@quentindrappier7609 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool I think i wasn't the fastest XD That was funny :D
@MateusGamer7
@MateusGamer7 Жыл бұрын
6:13 ouch, that caught me off guard lol
@anatolii720
@anatolii720 2 жыл бұрын
Fireship reminds me of Brackeys... deja vu ))
@andrewiglinski148
@andrewiglinski148 Жыл бұрын
Dude I've been working with javascript for 8 years and I just now learned that string literals in javascript insert line breaks... my mind is blown.
@monicaandhare
@monicaandhare Жыл бұрын
Thank you
@webdecodedwithfahad4414
@webdecodedwithfahad4414 2 жыл бұрын
Programming isn't about learning , it's about learning from fireship 😍
@aleksandarstevanovic5854
@aleksandarstevanovic5854 2 жыл бұрын
ASCII art will always be nice, what ever year it is :D and damn it, failed on fifth question, so close to a milion! :D
@m4rt_
@m4rt_ 2 жыл бұрын
a better way of doing it is instead of having separate question functions for the questions is having one with some parameters, for example: one for the question, one for an array of options, then one for the index in the array to specify which one is the correct one. That was how I did it. (You could also have an array of indexes if you have multiple correct answers) DRY
@ratikagrawal12
@ratikagrawal12 Жыл бұрын
After going through your videos, I get sense of accomplishment somehow. 😂
@user-jl7xw1oq5v
@user-jl7xw1oq5v 2 жыл бұрын
Although I'm not js developer, your content is amazing educational and entertaining at the same time Great video!
@Quicknuggets
@Quicknuggets 2 жыл бұрын
What theme do you use? i love to see the colors.. please share
@abderrahimbouzidi3631
@abderrahimbouzidi3631 2 жыл бұрын
you are awsome man !!!
@zealousprogrammer4539
@zealousprogrammer4539 2 жыл бұрын
JS has becoming the new Python with so many packages!!!!
@MrSuperNova46
@MrSuperNova46 2 жыл бұрын
If were to do it now can I still get a hoodie, or was that a limited time thing?
@krishagarwal
@krishagarwal 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool Making a cool CLI must be a milestone of your journey 😉
@MercyFromOverwatch2
@MercyFromOverwatch2 2 жыл бұрын
Jeff is still my favourite tech youtuber
@art_n_artist
@art_n_artist 2 жыл бұрын
which operating system u r currently using on ur desktop?
@FusionTerror
@FusionTerror 2 жыл бұрын
"To publish all your useless packages" 😂 . I love this channel, laugh every video.
@gamer-gw9iy
@gamer-gw9iy 2 жыл бұрын
Programming isn't about what you know: it's about making the command line look cool
@ZeroIntensity
@ZeroIntensity 2 жыл бұрын
you should take a look at the python textual library, probably the coolest tui lib in any language
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 364 М.
Is TypeScript (NodeJS) Faster than Go?? |  A server comparison
9:54
ThePrimeagen
Рет қаралды 214 М.
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 3,9 МЛН
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 31 МЛН
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 8 МЛН
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 138 МЛН
This CLI Tool is AMAZING | Prime Reacts
11:59
ThePrimeTime
Рет қаралды 78 М.
10 regrets of experienced programmers
8:16
Fireship
Рет қаралды 1,1 МЛН
Setup a Template-CLI for Quickly Instantiating Projects
16:35
How programmers flex on each other
6:20
Fireship
Рет қаралды 2,2 МЛН
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 253 М.
If this ships, it will change javascript forever
25:54
Theo - t3․gg
Рет қаралды 193 М.
AWS for the Haters in 100 Seconds
2:30
Fireship
Рет қаралды 864 М.
Tailwind CSS is the worst…
3:55
Fireship
Рет қаралды 1,4 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,6 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 1,7 МЛН