How to Set Up a Node.js Project
Vložit
- čas přidán 5. 06. 2024
- 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: czcams.com/users/thecodingtrainjoin
🛒 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
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 🤩
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.
@@master74200 bro few weeks !!! I know it's not rocket science but it's not that easy if .
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! 😄
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! ❤
These videos are great Dan! it's so refreshing to see videos from you that are not related to processing or p5.js
Finaly a node.js tutorial where I actually learned something. Thank you.
Daniel! Thank you for your wonderful tutorials! Your energy and enthusiasm are infective!!
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.
Setupping them is easy on my set up. I setupped many of them.
long time ago since i use nodejs and your video helped me to setup my project correctly. I don't remember a lot. 😂
Thanks for all the videos. A discord bot sounds like a good project to learn from. =]
Soooo hyped that you are covering Node.js! Would you ever consider covering TypeScript in the future? Would love to see that!
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)
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.
I'm a 3rd year CS major and I feel the same. The more we learn, the more we realise we know NOTHING!
@@lucbian That is how coding works lol
As a senior CS student I must say, we are just getting started
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.
The knowledge just comes from experience. Trying shit. Building things. Do that for a few months and it'll be very intuitive.
Another great introduction to get up and running with The Conding 🚂. Mastery of teaching 💡💖
Great teacher
`rm -rf node-project` is the best approach.
Your are amazing man
i would personally love to see you design a social media site with logins from scratch!
Thank you ❤
Need moreeeee :)
We missed you
Thank you !! i am the 3000 visitor !!
I love the way you explain things ❤❤
I've been hesitating to learn Node.js but now I am 100% ready.
非常棒
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.
He made a neural networks series. It's great.
Wow, this was an amazing tutorial, i finally understand a lot of thing about node, thanks so much, Greetings from Rome!!!
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❤🔥
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
Thank you for the info!
Oh man we really could've used this 2 weeks ago for our IMA lowres Connections Lab projects but I guess hindsight 20/20
Oh! Hello IMA Low Res! I hope these videos help!
Honestly I think watching these should be part of our homework! They're that good :)@@TheCodingTrain
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.
After 20 years .NET I had to move over to node.js. Your video's helped a lot! Great teacher!
Watching this makes me so happy I started with Python. What an over complicated language. Still very interesting.
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.
This is hardly different to python and pip? The only thing I'm seeing different is project structure?
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
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.
Everyone’s gotta start somewhere. I personally learned to code with js and later learned ts!
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.
Yes there is. There's a good amount of info online on how to do it.
@@lucbian Could you please share a repo or blog? Thanks.
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)
@@DipamSen Both
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
Sir, you are the best, thank you.
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
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.
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.
lol @detective work🤣
Are you gonna make a video about the correct way to make an MVC NodeJS server? 🙏🤩
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
Bun with TS, when? :D
I just wanna know when you launching a project
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
3:47 Is this a joke from the npm team or is this real ? 😆
It's from the official NPM twitter!
Why not both?
Not sure why it keeps telling me type error cowsay.say is not a function when trying to run it.
hmmmm, are you in the discord to maybe post your code / error screenshots?
Gonna try on my Windows machine as the other was on my mac@@TheCodingTrain
panic over i updated Node and re npm cowsay and all working now on mac after testing went all ok on PC@@TheCodingTrain
No Bun intended ?
🚅
*ring a ling a ling*
Thank you for refusing to name files with .mjs
utter non sense
Hey, I am back with you. I have been waiting for your contents, Sir.