Node.js and NPM Tutorial: readFile & writeFile, Require Modules, and Install Packages

  Рет қаралды 18,465

LearnWebCode

LearnWebCode

Күн бұрын

Join my premium 2024 bootcamp here learnwebcode.teachable.com/p/...
What is Node.js? Why would we want to use it and how do we get started? What is NPM and how do we use it? Let's cover all of that and more in this lesson.
0:00 Intro
1:23 Getting Started
3:58 Using Node
7:02 Running a File
8:50 Import / Export Separate File
11:39 readFile / writeFile
18:30 Core Features vs Community Packages
21:51 NPM
28:18 Outro
Playlist for this full series: • Brad's Bootcamp - Free...
Follow me for updates on new episodes:
Instagram: / javaschiff
Twitter: / learnwebcode
Facebook: / brad-schiff-1542576316...
Twitch: / learnwebcode

Пікірлер: 67
@edwinfeliz5487
@edwinfeliz5487 3 жыл бұрын
Now this is what I called a teacher, Thank you
@moomoo3578
@moomoo3578 Жыл бұрын
This video helped me quickly understand what NodeJS is all about. Now I can talk to developers to better understand their needs. I'm a DevOps by the way. Thank you so much. Can't wait to see how webpack works.
@duskairable
@duskairable 3 жыл бұрын
Brad you have teaching gift, love all of your tutorial videos.
@healerdance7
@healerdance7 3 жыл бұрын
I came here on your last video to tell you that you're the best teacher I ever watched. I watched your video "JavaScript Template Literals: JSON to HTML" and your explanation are so good and precise that I enjoyed watching it. Well done, u deserve more subs.
@DevMadeEasy
@DevMadeEasy 3 жыл бұрын
What a nice content! Thank you so much!
@steliosalexandrakis78
@steliosalexandrakis78 3 жыл бұрын
Wow! Coding suddenly just became fun! Kudos to you sir and your superb teaching skills!
@dadaradabada6928
@dadaradabada6928 2 жыл бұрын
bro i found your channel yesterday, i then proceeded to unsubscribe from almost 20 other channels focusing on mern stack ..u r the best!
@nekdo9590
@nekdo9590 3 жыл бұрын
i have watched two of your videos so far and your explanation is excellent 🙏
@frankherbert3779
@frankherbert3779 2 жыл бұрын
Very nice, helped me to get started. Cool!
@atouchofa.d.d.5852
@atouchofa.d.d.5852 3 жыл бұрын
This was a great intro!
@sheraz_razzaq
@sheraz_razzaq 2 жыл бұрын
Love you Brad
@afflictionmarketing5303
@afflictionmarketing5303 3 жыл бұрын
Although it's too late in India. But i can't wait till morning to watch this boot camp video tutorial. Before today, i used to horrified by the rumours about the command line and node. But after watching this video i am a bit confident that this is quite simple if you get the step by step guidance. It's more simpler if you have a teacher like Brad 👍 Great tutorial.
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Thanks so much! It's true, we've all had nightmares about the command-line at some point.
@ram-gb4xg
@ram-gb4xg 3 жыл бұрын
best teacher! great way of explaining, it'd be nice if you could make a video on Angular :) thanks
@lyricsmint567
@lyricsmint567 3 жыл бұрын
Where is "meow".?
@msvmanikantasrivishnu7788
@msvmanikantasrivishnu7788 3 жыл бұрын
Following your courses here and udemy thank you. Like and share all
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Thanks so much!
@vikrammehta4945
@vikrammehta4945 3 жыл бұрын
Thank you for this video. Your way of teaching is super awesome. I would like to learn node from you. Do you have any course that covers MERN stack.
@Habib_HBB_17
@Habib_HBB_17 3 жыл бұрын
Thank you
@andrewrico8321
@andrewrico8321 3 жыл бұрын
Best instructor ever...?
@thundy3348
@thundy3348 3 жыл бұрын
I'm this far into the playlist, and I felt I should mention how jelly I am of the braces. I really need them again but it's not in the budget right now. Good on your for taking care of your chompers dude!
@kirankumar-iz3tw
@kirankumar-iz3tw 3 жыл бұрын
Hi Brad...you are amazing in explanation...like magic... I am using two of your courses in Udemy...I am planning to taking html css course...is that worth?
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Thanks! The HTML & CSS course is designed for true beginners. If you're already up and running with the basics of HTML & CSS and just want to learn more advanced styling, etc... you can likely skip that course and instead try the "Git a Web Developer Job: Mastering the Modern Workflow" course.
@shahriarparvezshuvo4760
@shahriarparvezshuvo4760 3 жыл бұрын
I missed your cat today. 💔 But loved your Smile at the outro. 😍
@LearnWebCode
@LearnWebCode 3 жыл бұрын
😂 I need to start putting snacks on the desk so she makes a guest appearance in every video ❤️
@shahriarparvezshuvo4760
@shahriarparvezshuvo4760 3 жыл бұрын
@@LearnWebCode Haha. 😂 That's would be great. I would love to watch her playing around. 😍
@surendrababuchalla
@surendrababuchalla 3 жыл бұрын
Good 👍 video
@ibrahimali-xd3bw
@ibrahimali-xd3bw 2 жыл бұрын
Hi Brad, Thank you for this video! why my files icon do not change to express icon as your files ?
@mojtabayam
@mojtabayam 3 жыл бұрын
hi brad . please make a video about ES7
@davidson7838
@davidson7838 2 жыл бұрын
Hey Brad, I just bought your javascript course from Udemy, I have a question for you. do you have any plan to make a paid course on nodejs. I really like the way you teach, the methods and the pace etc... I will love to see a nodejs course from you on udemy. thank you.
@shargenezangana9320
@shargenezangana9320 3 жыл бұрын
Hello, first I would like to say how much I appreciate your work. I worked in the restaurant industry and during these times it has been very hard. I have 2 kids so I can afford any school. Fortunately I started self- studying CS about a year-and-a-half ago and you have been a great resource! I even signed up for your udemy class recently. I was wondering if you had any videos on Firebase. I'm currently working on a project that is a petition website. Essentially users fill out a form, then click a submit button, then their name would be added to database. I'm not too experienced with back end languages. I was told Firebase was a great an easy way to implement a back-end database. Building and designing the site I understand but how to implement a back-end database and to be able to submit collect and submit that database is foreign to me. Any help would be amazing! If not I still appreciate your time, your work, truly you are giving a great gift to humanity to helping others. Bless you sir and I wish you good fortune. If anyone comes across this comment watch this man's videos you will truly learn computer programming. He teaches in a way that is so clear and so precise and it breaks it down and very simple steps. I have learned from many online sources. And I would easily say this is probably top to top three that I have found. And this is after many online sources. Thank you again and I wish everyone the best on their Journey.
@jackepner9984
@jackepner9984 2 жыл бұрын
Agree, Brad's one of the best teachers for beginners learning to code. For Firebase, it is rather simple for an intro to backend database use.. do a search for some other resources, and you should be fine. I haven't learned it like I've learned other things (until Brad makes a course on that ;) ), but there are many tutorials online for projects using Firebase. Going through one of those may help you.
@travelingvibes7796
@travelingvibes7796 3 жыл бұрын
sir please can you make on nodejs course tutorial , like api and webapp without using library
@knightfallgame
@knightfallgame 3 жыл бұрын
I believe ive figured a part of the problem out which is that require() is only accesible on the server side and not the client side. Im building a monster generater that generates an object with the parameters the user inputs into the form then saves the object into a json file. But i have to figure out how to allow the client to write to a json file
@LearnWebCode
@LearnWebCode 3 жыл бұрын
That's right, "require" is only a part of Node.js, not JavaScript in the browser. If you just want the visitor to be able to generate monsters and save them on their own you might not need server-side code at all. You could look into the browser's localStorage.setItem() and localStorage.getItem() - I believe it can store up to 4 or 5mb of data. You can take a complex object and use JSON.stringify() and store the plain string in local storage, and then when you want to load from that you can use JSON.parse() etc... but yes, for actually persistent storage that won't disappear even if the user deletes their browser history/storage you'd want to save it to a database server side. Or if you want to let the user download their creation as a json file - I'd google for that and checkout the first StackOverflow result. Sounds like a fun project 🥳
@knightfallgame
@knightfallgame 3 жыл бұрын
@@LearnWebCode the local storage will probably work for the moment but i will eventually need get a server going and learn back-end which i finally have got going through alot of troubleshooting. yeah the monster generator is actually for me to generate these objects and then save into a monster.json that way i dont have to hardcode all the stats.. it was gonna be a desktop app that acts like a game engine part i guess.. I got the form successfully pushing my objects into an array and things are smooth on that end. I just thought itd be interesting to actually add it as a feature in my game. players could fill out their own monster ideas and then vote on them and then at the end of the month or somethin i could add the most popular vote to the game even giving the creator the first copy.
@knightfallgame
@knightfallgame 3 жыл бұрын
@@LearnWebCode by the way, very concise tutorial I appreciate your style of teaching.
@JimKernix
@JimKernix 2 жыл бұрын
So what is package-lock.json? Do you ever need to edit it or just leave it alone?
@LearnWebCode
@LearnWebCode 2 жыл бұрын
The package-lock.json file keeps track of the exact version of even the dependencies of our dependencies. There's no need to edit the file ourselves, and the file isn't absolutely necessary, but does help avoid situations where one tiny package releases an update/bug and then our entire project fails.
@techmathy5764
@techmathy5764 3 жыл бұрын
Eagerly waiting for this series❤️ There is one simple question. Suppose in JavaScript var capital="capital"; //capital is a variable But when i console.log(capital[0]) it gives answer as c Is variable is a simplest array?
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Good question. A string of text in JS is "array-like" in a couple ways, but not actually an array; they don't inherit everything from the Array.prototype, but they do have basic things like "length" and being able to use the [x] notation to get a certain character etc... For example if you try to call .map() or .push() on a string, it won't work.
@sohagroy9049
@sohagroy9049 3 жыл бұрын
Sir,I have taken a fully web development course from udemy by Dr. Angela Yu and then your javascript course & now I am doing your react course....Should I take your wordpress course as my next course....Or what type of course will be the best as next one.Please suggest.....
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Thanks for the support and taking my courses! There's no right or wrong answer, but in my opinion once you understand the "big picture" of full-stack and can connect the front-end with the back-end I think it's a good time to stop with courses and just practice, practice, practice building your own projects/apps for fun. Along the way, you'll run into roadblocks and can Google / KZfaq how to do certain things, but it's fun to have to apply it all towards one cohesive project you're trying to create, and you just keep repeating that process until one day you feel pretty confident.
@sohagroy9049
@sohagroy9049 3 жыл бұрын
@@LearnWebCode Thank you so much sir❤❤
@emmanouil1453
@emmanouil1453 3 жыл бұрын
In this course Brad teaches the internal architecture and customizations of WP while building a theme along with very useful project. Combined this with React for the rest of us and now developing React based plugins for WP, managing custom posts types and custom fields with javascript (and PHP).
@sohagroy9049
@sohagroy9049 3 жыл бұрын
@@emmanouil1453 Thank you for your kindly information.
@JimKernix
@JimKernix 2 жыл бұрын
How do I fix this: Uncaught ReferenceError: require is not defined? I can run the file in the terminal but not in the browser? I need to load text as a variable into a js file somehow.
@JimKernix
@JimKernix 2 жыл бұрын
why would i use exports, require and file system if I can't output it to a web page? WTF, how the hell do you use a file as a data source for a js file?
@JimKernix
@JimKernix 2 жыл бұрын
Ok, when I do fs. there are not ANY options coming up...?
@chintalasaikumar7584
@chintalasaikumar7584 2 жыл бұрын
module not found case ???
@rubenbelman7802
@rubenbelman7802 3 жыл бұрын
Ryan Dahl say I think Node is not the best system to build a massive server web. I would use Go for that. And honestly, that’s the reason why I left Node. It was the realization that: oh, actually, this is not the best server-side system ever.
@Pawan.1359
@Pawan.1359 3 жыл бұрын
Hello Sir, In your 10 days javascript you have told you will make an website to see what your friends are posting using MongoDB. I'm waiting for it.........
@knightfallgame
@knightfallgame 3 жыл бұрын
So I don’t need the require.js library to use the require(‘fs’) function? It comes standard with node? That’s so weird I’m having an error saying require is not defined. From what I looked up i needed to get the require.js library to use the require function. But that’s not workin either
@knightfallgame
@knightfallgame 3 жыл бұрын
Perhaps I have misread the error but I have to get some rest. Good evening world
@knightfallgame
@knightfallgame 3 жыл бұрын
Actually maybe I didn’t initialize the package.json could that be the issue?
@LearnWebCode
@LearnWebCode 3 жыл бұрын
You don't need to import or download the "require" function, it's always available in the Node.js global scope by default. For real-world projects you'll definitely want a package.json file, but things should still work without one. Is it possible you misspelled something by even one character?
@knightfallgame
@knightfallgame 3 жыл бұрын
No i checked very carefully to see if anything was mispelled. The only thing i could think of is that when i forst installed nodejs i remember there being some kind of error got thrown but the process still finished but i was able to get my live-server going so i didnt question it amd just got to work. That was weeks ago. But now im finally ready to write to a json file but this problem has arised. I will get the exact error and get back to you very shortly
@knightfallgame
@knightfallgame 3 жыл бұрын
Yeah it say uncaught reference error require is not defined. And in my terminal I have a GET/favicon.ico 404
@tanjirmahabub5105
@tanjirmahabub5105 3 жыл бұрын
Hello Sir, We want vue js 3 full tutorial with project
@MaxTheFireCat
@MaxTheFireCat 3 жыл бұрын
That one dislike is probably a bug because google haven't watched you videos
@shaderone07
@shaderone07 3 жыл бұрын
The very first video i watched on your channel was "Learn Json and Ajax" [ kzfaq.info/get/bejne/qLCVpsSUlcWqpKs.html&t -- if you guys wanna take a look at it (trust me , its awesome)]. With that 1 video I understood that You are "THE" Mentor that i.... no, we wanted. I just want to say that you have an amazing skill at explaining certain concepts in a way that each and every person can understand . Keep going . #support #Respect.
@thanasisathanasi4965
@thanasisathanasi4965 2 жыл бұрын
It sounds stupid to me to install nodejs on a mac and use it as a production server !!!! NodeJS runs on LINUX only !
@debanjanbarman7212
@debanjanbarman7212 3 жыл бұрын
Good tutorial sir but I already know all the topics so I'm gonna skip the video.
@LearnWebCode
@LearnWebCode 3 жыл бұрын
Good deal. After this we'll be learning webpack, and then after that we'll be jumping into the "Server" chapter.
@debanjanbarman7212
@debanjanbarman7212 3 жыл бұрын
@@LearnWebCode Please cover advanced webpack configuration also.
@chuithrowaway2864
@chuithrowaway2864 2 жыл бұрын
The unbiased quit contemporaneously preserve because panda consistently plug among a smooth rod. measly, one spot
@tomaszkantoch4426
@tomaszkantoch4426 3 жыл бұрын
Everything getting more complicated for no reason... modules..packages..who gives a shit . PHP can do it alone!
webpack Tutorial: devServer & Hot Module Replacement (Live Reload)
37:07
MongoDB Basics, CRUD and Node.js Integration
43:29
LearnWebCode
Рет қаралды 34 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 16 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 49 МЛН
Learn Express.js In 48 Minutes: Web Server Tutorial
47:39
LearnWebCode
Рет қаралды 57 М.
Programming: Functions and Objects in JavaScript
35:46
LearnWebCode
Рет қаралды 20 М.
CSS Tutorial: Basic Selectors and Styles
22:37
LearnWebCode
Рет қаралды 19 М.
Create An API: CORS, SPA / Client-Side Routing Explanation
40:35
LearnWebCode
Рет қаралды 25 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 418 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 555 М.
Heroku Express App Vs Netlify Serverless App - Free Node.js Hosting
32:28
File Handling in NodeJS
18:17
Piyush Garg
Рет қаралды 84 М.
How to use Multithreading with "worker threads" in Node.js?
19:34
Software Developer Diaries
Рет қаралды 52 М.