How to Set Up a Node.js Project

  Рет қаралды 61,390

The Coding Train

The Coding Train

Күн бұрын

Learn how to set up a Node.js project, run JavaScript code outside the browser, and use npm for package management! Code: thecodingtrain.com/tracks/dis...
🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-...
💻 Github Repo: github.com/CodingTrain/node-p...
🎥 Previous: • Workflow: Terminal, Sh...
🎥 Next: • I made a Discord Bot t...
References:
📂 fs module: nodejs.org/api/fs.html
📦 npm registry: www.npmjs.com/
🐮 cowsay package: www.npmjs.com/package/cowsay
🖼️ canvas package: www.npmjs.com/package/canvas
🤖 Discord Bot Examples: github.com/CodingTrain/Discor...
Timestamps:
0:00 Introduction
1:47 Running JavaScript code with Node
3:04 Creating a Node project
7:24 Using built-in Node modules
11:51 Installing and using third party packages
18:26 Working with existing Node projects
24:02 Summary
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: kzbin.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#nodejs #javascript #nodejs

Пікірлер: 85
@BIA_JOE
@BIA_JOE 7 ай бұрын
I’m so grateful. Don’t know if it’s me but it seems like you need to be born knowing what all of this stuff is, now that it is being explained to me I finally see light 🤩
@master74200
@master74200 6 ай бұрын
You don't. You just spend a few weeks or months with various tools, and it'll rapidly be completely intuitive to you how everything would work. Learn some computer fundamentals, and your intuitive perspective will widen.
@anshswaroop6849
@anshswaroop6849 6 ай бұрын
@@master74200 bro few weeks !!! I know it's not rocket science but it's not that easy if .
@patricioisaiascv
@patricioisaiascv 7 ай бұрын
Thanks for your amazing teaching, Daniel! I started creative coding in 2018 because of you. I'd love to enroll in ITP and meet you someday. Greetings from Chile! 😄
@Manticore_007
@Manticore_007 6 ай бұрын
Thank you so much for teaching the basics! I couldn't find a decent video explaining what you need and what it does. Superb as always, and again; love the energy! I love watching you teach! ❤
@HeadmostCantaloupe
@HeadmostCantaloupe 5 ай бұрын
These videos are great Dan! it's so refreshing to see videos from you that are not related to processing or p5.js
@isaacbaptista6207
@isaacbaptista6207 7 ай бұрын
Finaly a node.js tutorial where I actually learned something. Thank you.
@sajidhaniff01
@sajidhaniff01 7 ай бұрын
Daniel! Thank you for your wonderful tutorials! Your energy and enthusiasm are infective!!
@AurelioKessler
@AurelioKessler 3 ай бұрын
long time ago since i use nodejs and your video helped me to setup my project correctly. I don't remember a lot. 😂
@ColinTimmins
@ColinTimmins 7 ай бұрын
Thanks for all the videos. A discord bot sounds like a good project to learn from. =]
@mastermobo4554
@mastermobo4554 6 ай бұрын
Soooo hyped that you are covering Node.js! Would you ever consider covering TypeScript in the future? Would love to see that!
@geoffwagner4935
@geoffwagner4935 6 ай бұрын
my favorite visual studio them i've had for months is "Outerspace Next" - alien invasion , much softer on the eye and colors are like candy. OceanDeeper was close but, it's much more conveniently and nicely colored on the other. i liked the ocean colors, but the text colors usually aren't as amazing to me.
@andrewdunbar828
@andrewdunbar828 7 ай бұрын
Setupping them is easy on my set up. I setupped many of them.
@santicanog_
@santicanog_ 7 ай бұрын
Another great introduction to get up and running with The Conding 🚂. Mastery of teaching 💡💖
@tylerbakeman
@tylerbakeman 6 ай бұрын
I love working in P5.js - it’s easy to use. P3 was my favorite IDE for casual Java development - P4 was my least favorite (P3 had a more professional look and feel - and all of my code broke during the transition). So, now I use Eclipse for everything (until I land a job where they probably use VisualStudio or some random unheardof IDE)
@Samuel-eg5wc
@Samuel-eg5wc 7 ай бұрын
How do you have so much knowledge for all these code-based programs? Im a first year cs major and seeing you explain every single thing you do so clearly makes me feel so dumb😭. Thank you so much for your videos. I never knew watching someone else code would be so entertaining.
@lucbian
@lucbian 7 ай бұрын
I'm a 3rd year CS major and I feel the same. The more we learn, the more we realise we know NOTHING!
@stio_studio
@stio_studio 7 ай бұрын
@@lucbian That is how coding works lol
@snakefinn
@snakefinn 6 ай бұрын
As a senior CS student I must say, we are just getting started
@Trizzi2931
@Trizzi2931 6 ай бұрын
I am a masters student and i was feeling same when I was in third year. One thing i would suggest would be to use this knowledge and actually do something. Make projects it doesn’t have to be creative or anything like that just go ahead and make pne entire by yourself. Also form habit of reading docs after you have learned basic points. And last thing is try to learn linux I know it’s not directly related to nodejs but if you go into the job market, it’s one skill that everybody asks for. If you have macOS then no need to install anything else as it’s already an unix system but for windows I would recommend dual booting.
@master74200
@master74200 6 ай бұрын
The knowledge just comes from experience. Trying shit. Building things. Do that for a few months and it'll be very intuitive.
@deltaforce3329
@deltaforce3329 7 ай бұрын
Thank you !! i am the 3000 visitor !!
@__nicfit__
@__nicfit__ 4 ай бұрын
`rm -rf node-project` is the best approach.
@lucasferrero123
@lucasferrero123 6 ай бұрын
We missed you
@ghazalehabadian6536
@ghazalehabadian6536 6 ай бұрын
Great teacher
@k.6028
@k.6028 5 ай бұрын
i would personally love to see you design a social media site with logins from scratch!
@volodymyrselevertov
@volodymyrselevertov 6 ай бұрын
Your are amazing man
@dipendranath6429
@dipendranath6429 6 ай бұрын
I love the way you explain things ❤❤
@anon_y_mousse
@anon_y_mousse 7 ай бұрын
I decided to follow along with this one because I've never used npm or node for anything I've written. I have no idea if I installed node or if I'm using the one that came with Slackware, but apparently I'm on v20.0.0. One weird thing, I don't know if it's a bug in my version, but cowsay ignores the cow field. I tried importing SQUIRREL and it says it's not found. All the solutions suggested by node when it displayed the various error messages don't work, and I even tried just using "squirrel" and it gave no error and just used the standard cow. I figured I'd also make some suggestions of my own while I'm at it. Consider adding to your ~/.bashrc: mkcd() { if [ $# -ne 0 ]; then mkdir "$1"; cd "$1"; fi; } and alias ..='cd ..' alias ...='cd ../..' etc. And for a neat trick, cd - will take you to the immediately previous directory you were in, cd on its own will take you home.
@3zdayz
@3zdayz 7 ай бұрын
Renaming to mjs let's you mix cja and mjs files. It also differentiates it's a node module. Typically it's improbable that is files for node would also work in a browser
@TheCodingTrain
@TheCodingTrain 7 ай бұрын
Thank you for the info!
@cholo2605
@cholo2605 6 ай бұрын
Wow, this was an amazing tutorial, i finally understand a lot of thing about node, thanks so much, Greetings from Rome!!!
@ihsannuruliman4005
@ihsannuruliman4005 6 ай бұрын
Dan will you make a series about machine learning (and data science in general) from scratch? Because the playlist about ML is basically about ML engineering. I thank you for that, but I want to see more. From the math and how to contruct the algorithm.
@delekmiller2362
@delekmiller2362 6 ай бұрын
He made a neural networks series. It's great.
@lomzart
@lomzart 7 ай бұрын
Hey hey, first thanks for all really you are the best! Please make a twitter bot that can post a canvas image as a post. Thanks❤‍🔥
@faBi_292
@faBi_292 7 ай бұрын
Need moreeeee :)
@Yazan_Majdalawi
@Yazan_Majdalawi 6 ай бұрын
I've been hesitating to learn Node.js but now I am 100% ready.
@prasitsingh6713
@prasitsingh6713 5 ай бұрын
After running these 2 commands I still cant get node_modules folder npm init -y npm install Why is it like that? I’m stuck here for 3 weeks. Please help But when i download someone else project and run the same commands it creates node_modules folder
@juggernogking4829
@juggernogking4829 7 ай бұрын
Thank you ❤
@robw3000
@robw3000 7 ай бұрын
After 20 years .NET I had to move over to node.js. Your video's helped a lot! Great teacher!
@spicymishka
@spicymishka 7 ай бұрын
Oh man we really could've used this 2 weeks ago for our IMA lowres Connections Lab projects but I guess hindsight 20/20
@TheCodingTrain
@TheCodingTrain 6 ай бұрын
Oh! Hello IMA Low Res! I hope these videos help!
@spicymishka
@spicymishka 6 ай бұрын
Honestly I think watching these should be part of our homework! They're that good :)@@TheCodingTrain
@user-ru8bq6vl5t
@user-ru8bq6vl5t 6 ай бұрын
非常棒
@caryrabbit
@caryrabbit 7 ай бұрын
Watching this makes me so happy I started with Python. What an over complicated language. Still very interesting.
@master74200
@master74200 6 ай бұрын
Python is also very complicated, but in different ways. And in the same ways too. Dynamically typed languages are very complicated though, I do agree.
@letsgocamping88
@letsgocamping88 5 ай бұрын
This is hardly different to python and pip? The only thing I'm seeing different is project structure?
@hillolbarman
@hillolbarman 7 ай бұрын
I would really like to know if there is way to use p5 in node/react project. Where all the position calculations and maths of the animation is done separately and draw functions independently renders the updated values at a constant framerate. An example would be great too.
@lucbian
@lucbian 7 ай бұрын
Yes there is. There's a good amount of info online on how to do it.
@hillolbarman
@hillolbarman 7 ай бұрын
@@lucbian Could you please share a repo or blog? Thanks.
@DipamSen
@DipamSen 6 ай бұрын
Do you mean using it in node (on the server, eg. For generating images), or using it with a client sida framework like react (same function as p5.js in the browser, just in the context of a framework)
@hillolbarman
@hillolbarman 6 ай бұрын
@@DipamSen Both
@geoffwagner4935
@geoffwagner4935 7 ай бұрын
I was wanting a small collection or drones, i think i want a small collection of Raspberry pi after all the Dan's node and express stuff xD
@juanmacias5922
@juanmacias5922 7 ай бұрын
Bun with TS, when? :D
@sanveersingh3513
@sanveersingh3513 7 ай бұрын
I'm learning JS, but a lot of projects rely on third party libraries, If I install then vulnerability list going up, if I do audit fix then project dont run any advise
@supercrafter100
@supercrafter100 7 ай бұрын
The vulnerabilities ideally should be fixed by the authors of libraries you're using. There isn't really much you can do yourself. Either use different libraries or just live with the fact that they're there. Often these vulnerabilities aren't really that severe but it's obviously ideal if there are none.
@master74200
@master74200 6 ай бұрын
Try to do what you need to without a library. It's not easy, but you can do it. Keep doing that, and you'll see that most packages aren't needed at all.
@wrt3778
@wrt3778 3 ай бұрын
Sir, you are the best, thank you.
@pannasstuff1466
@pannasstuff1466 4 ай бұрын
lol @detective work🤣
@kebro135246
@kebro135246 6 ай бұрын
Are you gonna make a video about the correct way to make an MVC NodeJS server? 🙏🤩
@TheCodingTrain
@TheCodingTrain 6 ай бұрын
I don't write a lot of "correct" code 😂 Are these videos what you are looking for? thecodingtrain.com/tracks/data-and-apis-in-javascript/data/2-data-selfie-app/1-server-side-with-node-js
@CuttDaMuzik
@CuttDaMuzik 5 ай бұрын
I just wanna know when you launching a project
@zheil9152
@zheil9152 6 ай бұрын
For anyone watching this to learn and get started with JS in any serious capacity in the future, do yourself a favor and use typescript. It makes your life a thousand times easier and your coworkers one day will thank you.
@supercrafter100
@supercrafter100 6 ай бұрын
Everyone’s gotta start somewhere. I personally learned to code with js and later learned ts!
@geoffwagner4935
@geoffwagner4935 7 ай бұрын
i made a third database with username, password, and a messenger page yesterday that put the user in the message on my node express yesterday
@MailDeliverySystem-xw6hh
@MailDeliverySystem-xw6hh 7 ай бұрын
No Bun intended ?
@TheSteveMorganShow
@TheSteveMorganShow 6 ай бұрын
Not sure why it keeps telling me type error cowsay.say is not a function when trying to run it.
@TheCodingTrain
@TheCodingTrain 6 ай бұрын
hmmmm, are you in the discord to maybe post your code / error screenshots?
@TheSteveMorganShow
@TheSteveMorganShow 6 ай бұрын
Gonna try on my Windows machine as the other was on my mac@@TheCodingTrain
@TheSteveMorganShow
@TheSteveMorganShow 6 ай бұрын
panic over i updated Node and re npm cowsay and all working now on mac after testing went all ok on PC@@TheCodingTrain
@loic.bertrand
@loic.bertrand 7 ай бұрын
3:47 Is this a joke from the npm team or is this real ? 😆
@TheCodingTrain
@TheCodingTrain 7 ай бұрын
It's from the official NPM twitter!
@PhilBoswell
@PhilBoswell 7 ай бұрын
Why not both?
@AndyNotSoSmart
@AndyNotSoSmart 4 ай бұрын
🚅
@vikingthedude
@vikingthedude 6 ай бұрын
Thank you for refusing to name files with .mjs
@geoffwagner4935
@geoffwagner4935 6 ай бұрын
*ring a ling a ling*
@geoffwagner4935
@geoffwagner4935 6 ай бұрын
utter non sense
@rizgamingvids
@rizgamingvids 7 ай бұрын
Hey, I am back with you. I have been waiting for your contents, Sir.
I made a Discord Bot that says Choo Choo
33:15
The Coding Train
Рет қаралды 38 М.
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 748 М.
100❤️
00:20
Nonomen ノノメン
Рет қаралды 61 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 56 МЛН
Node.js Project Structure and Architecture Best Practices
7:38
Software Developer Diaries
Рет қаралды 20 М.
Never install locally
5:45
Coderized
Рет қаралды 1,6 МЛН
Workflow: Terminal, Shell, Node.js, VSCode
23:30
The Coding Train
Рет қаралды 70 М.
Coding Challenge #132: Fluid Simulation
54:31
The Coding Train
Рет қаралды 624 М.
Coding Challenge 177: Soft Body Physics
29:09
The Coding Train
Рет қаралды 148 М.
2.1 Server-side with Node.js - Working with Data and APIs in JavaScript
18:17
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 910 М.
A new approach to container and wrapper classes
25:27
Kevin Powell
Рет қаралды 243 М.
100❤️
00:20
Nonomen ノノメン
Рет қаралды 61 МЛН