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

  Рет қаралды 486,319

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

Пікірлер: 713
@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 5 ай бұрын
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
@juleswinnfield1437
@juleswinnfield1437 Жыл бұрын
I love this video - I'm new to JS and seeing you break down all these useful packages is super cool! Thanks :)
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis 2 жыл бұрын
Oi! My packages aren't useless! Stellar job as usual Jeff, your videos are always a joy.
@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.
@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!
@wowkster
@wowkster 2 жыл бұрын
Another great video as always. Really looking forward to the full Prisma tutorial
@felipeventura6176
@felipeventura6176 2 жыл бұрын
I had the idea to build a small cli game using node for a role I'm applying, this helped me immensely, thanks!
@mayanxoni
@mayanxoni 2 жыл бұрын
This video was awaited asynchronously!
@BenedictGS
@BenedictGS 2 жыл бұрын
The amount of content you are posting, i am liking it.
@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.
@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.
@obiaboimmanuel8729
@obiaboimmanuel8729 2 жыл бұрын
wow i was shocked seeing you used node for this, this is really awesome
@usama57926
@usama57926 2 жыл бұрын
Your sense of humor is amazing...
@rtemis9016
@rtemis9016 2 жыл бұрын
This is awesome Jeff!!
@salarhashemian3436
@salarhashemian3436 2 жыл бұрын
I learned alot of things, thanks man!
@edwardblewitt1961
@edwardblewitt1961 2 жыл бұрын
This guys videos are so good atm!
@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
@hannad
@hannad Жыл бұрын
Imagine building all of it without any packages. That would be a nice and informative video to watch.
@lauralegerofficial
@lauralegerofficial 2 жыл бұрын
Another video from my favorite KZbinr. 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 KZbin 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
@andrzejkulakowski
@andrzejkulakowski 2 жыл бұрын
It's amazing how colors speak to me even in CLI :D
@pcgs_
@pcgs_ 5 ай бұрын
Nice tutorial, thank you.
@maximood-tired
@maximood-tired 2 жыл бұрын
thank you bro this is exactly what i need right now
@SoreBrain
@SoreBrain 2 жыл бұрын
BRUH THIS CONTENT IS SO GOOD
@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
@DrNabeel20
@DrNabeel20 2 жыл бұрын
Super useful :)
@MattMcT
@MattMcT 2 жыл бұрын
Is it just me or does this video get BETTER each time?
@cineverseproductions
@cineverseproductions 2 жыл бұрын
bruh, you have a strong command on programming. Great work again. 👍
@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
@shantanusharma4901
@shantanusharma4901 2 жыл бұрын
Very good sir, you are JavaScript expert
@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
@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.
@dan_le_brown
@dan_le_brown 2 жыл бұрын
Jeff! I love your videos 😭
@shine.m202
@shine.m202 2 жыл бұрын
Thank you!
@rida4002
@rida4002 2 жыл бұрын
It freaking amazing to have your bug in the news.
@lord-sive
@lord-sive 2 жыл бұрын
Programming isn't about what you know; it's about improving technology
@craftoverflow
@craftoverflow 2 жыл бұрын
so good!
@daniel7007
@daniel7007 Жыл бұрын
Awesome!
@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 KZbin 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.
@Lostpanda123
@Lostpanda123 2 жыл бұрын
So cool!
@AmitKumarKhare
@AmitKumarKhare 2 жыл бұрын
Thank you, Jeff. :)
@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.
@KevinChromik
@KevinChromik 2 жыл бұрын
Finished the Quiz 🎊
@TheBaldr
@TheBaldr 2 жыл бұрын
Legend of the Red Dragon was one of the best command line/BBS door games ever made.
@toddy5153
@toddy5153 2 жыл бұрын
Good project. Observation: minute 3:03, use setTimeout(ms), from 'timers/promises'.
@farhadbagheri5687
@farhadbagheri5687 2 жыл бұрын
U R best programming channel in youtube
@yorgosdimitriadis3874
@yorgosdimitriadis3874 Жыл бұрын
Also, it would be interesting to see short video about cli theme engines, like oh my posh and so forth
@FusionTerror
@FusionTerror 2 жыл бұрын
"To publish all your useless packages" 😂 . I love this channel, laugh every video.
@shubhampatel6908
@shubhampatel6908 2 жыл бұрын
As always, learnt a lot in a very short time, Thanks
@YESHTOFU
@YESHTOFU 2 жыл бұрын
Had fun :)
@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.
@NNNedlog
@NNNedlog 2 жыл бұрын
I'm gonna try this
@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
@SperkSan
@SperkSan 2 жыл бұрын
awesome video i used chalk all the time but didn't know there was a package for gradient
@CoryTheSimmons
@CoryTheSimmons 2 жыл бұрын
Thank ya!
@victortruong2538
@victortruong2538 8 ай бұрын
2:11 the "Hi mom" hurts a lot now. Take care fireship we are very proud of you.
@mzpl7357
@mzpl7357 2 жыл бұрын
I was looking for lists like the ones you can create with 'Inquirer'. Thank you.
@abderrahimbouzidi3631
@abderrahimbouzidi3631 2 жыл бұрын
you are awsome man !!!
@MateusGamer7
@MateusGamer7 Жыл бұрын
6:13 ouch, that caught me off guard lol
@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
@monicaandhare
@monicaandhare Жыл бұрын
Thank you
@mrashad_com
@mrashad_com 2 жыл бұрын
In just 6:24 min. you explained too much useful tools/libs, thank you very much
@joakimrosenfeldt9530
@joakimrosenfeldt9530 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool And it's absolutely true
@AlexanderJohnLee
@AlexanderJohnLee 2 жыл бұрын
Programming isn't about what you know; it's about making the command line look cool!
@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 🔥🔥🔥
@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 :)
@murilomazzeu9355
@murilomazzeu9355 2 жыл бұрын
omg, I love u channel bro
@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
@jacksaxby4072
@jacksaxby4072 2 жыл бұрын
Programming isn’t about what you know; it’s about making the command line look cool
@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
@anatolii720
@anatolii720 2 жыл бұрын
Fireship reminds me of Brackeys... deja vu ))
@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!
@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.
@ash.mystic
@ash.mystic 2 жыл бұрын
Anyone remember command-line MUDs from back in the day? :) This makes me want to create one with the modern tools available today.
@barungh
@barungh 2 жыл бұрын
"the one thing that makes developer different than the common people out there is the command line" - thanks for saying this 😎
@zealousprogrammer4539
@zealousprogrammer4539 2 жыл бұрын
JS has becoming the new Python with so many packages!!!!
@MercyFromOverwatch2
@MercyFromOverwatch2 2 жыл бұрын
Jeff is still my favourite tech youtuber
@VKD007
@VKD007 2 жыл бұрын
`Programming isn't about what you know; it's about making the command line look cool`
@SRINIVAStheDEVELOPER
@SRINIVAStheDEVELOPER 2 жыл бұрын
ohh man that was literally awesome and easy for the one who look at the git source code but it's too late now but still I'm a winner coz `Programming isn't about what you know; it's about making the command line look cool`.^_^
@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.
@bluefury118
@bluefury118 2 жыл бұрын
Programming isn't about what you know; it's about making the command like look cool.
@simondoesstuff
@simondoesstuff 2 жыл бұрын
Incredible as usual
@offroaders123
@offroaders123 2 жыл бұрын
Brooo, I can't believe I showed up in your video! I'm not sure how I was the first comment for the colors.js sitation either, that was some crazy random timing for how big of a thread that turned into 😅
@dukenukem8381
@dukenukem8381 2 жыл бұрын
We used to have this text animations Demos in MS DOS
@victorgutierrez5785
@victorgutierrez5785 2 жыл бұрын
Programming isn't about what tou know; it's about making the command line look cool
I built a JavaScript framework
10:11
Fireship
Рет қаралды 488 М.
This CLI Tool is AMAZING | Prime Reacts
11:59
ThePrimeTime
Рет қаралды 78 М.
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 18 МЛН
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 14 МЛН
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 268 М.
Is TypeScript (NodeJS) Faster than Go?? |  A server comparison
9:54
ThePrimeagen
Рет қаралды 215 М.
Node.js Project Structure and Architecture Best Practices
7:38
Software Developer Diaries
Рет қаралды 24 М.
How programmers flex on each other
6:20
Fireship
Рет қаралды 2,2 МЛН
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 198 М.
Is "edge" computing really faster?
8:14
Fireship
Рет қаралды 584 М.
5 Command Line Tools That Boost Developer Productivity (2023)
8:02
Chrome Ships With This TERRIBLE Code (it took me so long to debug...)
11:45
Intel chips can’t possibly be this bad… 100% crash rate?
3:45
Сколько реально стоит ПК Величайшего?
0:37
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1,3 МЛН
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Кинг Комп Shorts
Рет қаралды 1,8 МЛН