Node.js How Modules Works & NPM #02
Skills:
Tool Use & Function Calling85%
Full Tutorial:
http://go.ipenywis.com/ipenydac9
--- Official Links----
Official Website: http://ipenywis.com
Official Facebook: http://go.ipenywis.com/ipeny4907
Official Twitter: http://go.ipenywis.com/islem9a03
Official GitHub Repo: http://go.ipenywis.com/ipeny5c0e
---Support US---
By Becoming a Patreon: http://go.ipenywis.com/ipeny5024
What You'll Learn
This video tutorial covers Node.js modules and NPM, demonstrating how to import and export modules, install packages, and manage dependencies using tools like Node.js, NPM, and Express.
Full Transcript
helping guys are all doing welcome to the second episode on the node.js series of explaining ideas and the modules so in this actually tutorial we're going to explain the modules and why you need to use them in your application and why actually they have a very very important thing to use and what is actually an MDM so NPM is the node package or node Nordia Smulders package manager so it's like a package managers that allow you to find packages and install them the eruption into your nodejs application or repository so here if we go to them MPN j is calm you can find packages easily you can call them packages or modules packages for bigger more scalable things and modules for a smaller one but there's a much everything so you can find packages for example is the request package in here or the request model what's actually allow you to do is a simplified HTTP request so you can just send request from your application into an HTTP server out there and get responses very easily so to wrapper and do the HTTP api it may gonna make your life easier and for send HTTP requests and receiving responses in here and a lot of other things you can use right out of a box in here so let me just briefly explain how modules work and how you can use them on your like application in here i have made that genius file in here and i want to create another file in here to represent how things actually work so let me just I don't know modules or my mods for example like my modules in here that you shouldn't call this something English so let me just put that in the main directory so in here I'm gonna create another file I don't know let's call this utils cough genius so like let's say this has the needed functions or the chills functions that I don't get any use on my application so Justice Bureau functions so actually how are those words you cannot use require the require function will require method so when you put the name of module no T is gonna go and find that into the file system then I'm gonna grab everything into that file and just gonna put this into your under your memory or your RAM and whenever you just need to call a function or something you're just gonna go to the round and grab the function and let you execute that right out the box in very very easy and simplified way so this how actually the require if you have been here in the parts if you don't so require just used to import modules even what is that heart and start from the npm so as i've said all you do is declare power point if so let's say me for example so this time anywhere else that's another one let's select declare a function gets full name and this function is gonna return my knee so how can I access that name from from another like from the main genius um how can I require this how can I make this file a modular and it can require to the major gears so you can use this function get for me and get get over it so all you do is use the exports keyword from the node a specific thing so from like every model no Jason objects how you do that you export things so exports don't say and you put the name so let's say get full name and it's gonna equals this function and whenever we're gonna call or require this into the main top J as we can it uses right out of the box so this like you very really simple I'm simplifying thing I don't know let me just use this so we can acquire that require my shirts under the current directory I'm gonna put you tails in here and I'm gonna require so let's use Hills so whenever we want to call this function so what we do is just go there down here let me just console.log my name and for example we put my name and put utils don't get for me as I've said this will return the full name that is stored in the only other fun you can also use ESX imports for some of you say like why not use the ESX exponent for keywords rather than using that this is like more efficient thing and more noj's compatible thing so just use it for node.js module something like this now if you execute that and we puts like node meas this should friends my name is it something you associate as I've said and as you can see actually here and we don't have a name here defined so to find end of the utils but we're requiring it then we get the full name so whenever you want to export something to use it on another file or another module or something like that use the export keyword and get for me then assign the the name you wanna off your function or your class or your variable then assign it to to the the variable or the body you want to export over here and it's gonna just work absolutely fine in here everything is very simple finally as I've said also another thing you can use variable that we have been talking about so just put down and we can just examine how things like works in here so all we do is just let me use the require function and let's say we are going to require the utils again so utils and let me just put this like in the current directory and the well so to actually show what the require returns in here so what does that require think is going to return in here just gonna return an object so if you execute that we get an object and it only has to get full name function and that function so since we are exporting that so requires gonna go ahead a look utyos' and find any export function or into the exports objects and data signage or returning him in that particular object that's why we're getting the get form name and the type of that is a function so this all what require does on specific modules if you have been using node.js for now so require we're just gonna go ahead require and use the export functions in here and I'm gonna give you that specific things so you can use that export function to export anything any type of data from one module to another or you can use the test in your application in years I've said it's very very efficient and really easy to use also the other thing if your might be wondering how you can install modules stuff already be defined so the modules from only NPM and you can also just go ahead and search for them let's say Express and Express it out the the framework that will allow you to create service back-end service using javascript in ojs and actually this like a very very popular thing and it's very really use of non-being so you can just all you do is npm install then put the module name so let's say the request since it's just minimalistic and the other one we're gonna explain is just the save and the save damn what are the differences between those so the save flag is just gonna save it as and made your dependency which means when you finish with the application so you want to keep for you two to your services it's a web application so you want to deploy it from your local development environments into your distributed or cloud d-block development server or development environment so you wanna order your production server option so you wanted to point from a local machine and do the other one all you do is just deploy the I'll take all the files it's not just gonna work like this because we are saving in here when we puts we're gonna save two different things two different type of dependency is gonna save the dependencies normally been disease and the dev dependencies and the dev dependencies are all available in your local machine so whenever you deploy it is not going to be available to the production server but for we just use the safe bag without the - death this cannot be available or gonna be deployed into the actual service show things like the request thing so in it must be deployed so let's say for example you are going to use webpack it's just gonna be involved for developing because this is gonna compile files on your machine and that's it so it's not gonna be using the production server Express just gonna be use it only or you're just gonna use on the production server just use the same or Celsius request so the same flag NPM install request and now just aren't gonna just do the request and start looking for our package and then installing it and you're gonna find like a boulder and you're just gonna appear miss acumen here it's called node modules which going to hold everything as I've said node modules in here all the modules are needed also the modules I like the double order from all the repositories with your machine works where like a cup of repositories or milk for depositories so we gotta find all the modules in here from the cache and actually everything's gonna be settled up in here also the standard model that's only the one you download the standard one like the file systems how we enter the file system that will allow you to interact this finds a lot of other things but all of them gonna be stored into the node modules on your roots type rectory so a simple style you can use and specifically install modules put your application in a very very simple in a minimalistic a way so I guess the pretty much god guys that was very very quick tutorial just explaining more how models work and how actually require works and how you can explore things between or export functions or dr types from one model to another in a very simple and minimalistic way so I think that's watching as you can I will catch you in the next one what about really going to do the Express server and just show you a very quick demo or a very quick example of how you can use no tears for creating a web server on your local machine so as I've said I will catch you in the next one
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from CoderOne · CoderOne · 22 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
▶
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Laravel CMS | N-01 | Getting Started and Environment Set Up
CoderOne
Laravel CMS | N-02 | Routes, Controllers and Views
CoderOne
Laravel CMS | N-03 | Dealing With Assets and Page Layouts
CoderOne
Laravel CMS | N-04 | Migration, Models and Adding Categories
CoderOne
Laravel CMS | N-05 | Showing Added Categories, and Session Messages
CoderOne
Laravel CMS | N-06 | Edit\Remove Categories using AJAX and Popups
CoderOne
Laravel CMS | N-07 | Add New Post
CoderOne
Laravel CMS | N-08 | Creating a Basic Laravel Blog
CoderOne
HTML5 Canvas For Beginners | Getting Started | #01 with Webpack
CoderOne
HTML5 Canvas For Beginners | Drawing Basic Shapes | 02
CoderOne
HTML5 Canvas | Drawing Text With Circles | Part 01
CoderOne
HTML5 Canvas | Text Animation and Circle Collision | Part 02
CoderOne
Complete Guide To Web Development In 2018
CoderOne
AJAX & JSON Explained | Examples
CoderOne
Visual Studio Code Web Development Setup and Extensions
CoderOne
Electron Build Desktop Apps HTML/CSS/JS - Getting Started 01
CoderOne
Electron Build Desktop Apps HTML/CSS/JS | Creating Windows and Processes 02
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Dialog, Sessions and Cookies 03
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Custom App Menu & Context Menu 04
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Package, Build and Deploy your App 05
CoderOne
Node.js Brief Beginners Introduction #01
CoderOne
Node.js How Modules Works & NPM #02
CoderOne
Node.js Working With Events and Event Emitter #03
CoderOne
Node.js File System (Read and Write) FS 04
CoderOne
Node.js Create a Basic Server Using Express 05
CoderOne
Json Web Token Authentication JWT Explained Securing API
CoderOne
CSS Flex Box Design | Practical Examples |
CoderOne
API How It Works With Practical Examples
CoderOne
MongoDB Getting Started 01
CoderOne
MongoDB Working with APIs and Practical Examples
CoderOne
Create a Command Line Interface (CLI) Using Node JS #01
CoderOne
Create a Command Line Interface (CLI) Using Node JS 02
CoderOne
Build React Apps | Introduction And Getting Started #01
CoderOne
Build React Apps | Working With Components And Multiple Rendering #02
CoderOne
Build React Apps | App State Management | Practical Examples #03
CoderOne
Build React Apps | Getting Started With Flux (Intro) #04
CoderOne
Build React Apps | Create a Clock Timer Using React 05
CoderOne
Build React Apps | Create a Clock Timer Using React 05 | PART2|
CoderOne
CSS Preprocessors Getting Started | SASS and LESS | Practical Examples
CoderOne
Regex Introduction | Learn Regular Expressions 01
CoderOne
PHP VS Node.js Which is Best For Web Development
CoderOne
Drag and Drop Using Native Javascript 01
CoderOne
Drag And Drop Using Native Javascript 02
CoderOne
Master Git (Version Control) in One Video From Scratch
CoderOne
Let's Learn The New Javascript ES6 Class Syntax
CoderOne
Let's Create A BlockChain On Node.js
CoderOne
Best Online Code Editors For Web Developers
CoderOne
Let's Create a Modern Login Form on React #01
CoderOne
Let's Create a Modern Login Form on React #02
CoderOne
Laravel CMS | N-09 | Admin Registration
CoderOne
Laravel CMS | N-10 | Login and Authentication
CoderOne
Let's Create a Twitter Bot (Listen and Retweet)
CoderOne
Rapid Webpage Creation With Emmet (HTML & CSS)
CoderOne
Create Popups and Modals Using Native Javascript, HTML and CSS
CoderOne
Promises and Callbacks on Javascript With Practical Examples
CoderOne
Create Collapses using Native Javascript, HTML and CSS
CoderOne
Let's Learn Typescript (Javascript Devs) | Getting Started 01
CoderOne
Let's Learn Typescript | Interfaces and Generic Types (The Typing System) 02
CoderOne
Let's Learn Typescript | Work With Classes, Modules and Enums 03
CoderOne
Let's Learn Typescript | React and Webpack With TS 04
CoderOne
More on: Tool Use & Function Calling
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
7 Best AI Tools for Research, Coding, and Development in 2026
Medium · Data Science
7 Best AI Tools for Research, Coding, and Development in 2026
Medium · Programming
How to Write a Project Status Report With AI in 15 Minutes
Medium · AI
7 AI Tools That Can Save You Hours Every Week
Medium · AI
🎓
Tutor Explanation
DeepCamp AI