Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Chat boat

Rating
-
Sold
-
Pages
1
Uploaded on
04-03-2023
Written in
2022/2023

Summary of 1 pages for the course Node.js at Node.js (Making boats)

Institution
Course

Content preview

In this lecture, I 'm going to show you how to install note and build your first node application.
You in this lecture. I want you to install the latest stable version of note. the code that we're
going to write in this course will continue to work with the future versions of note. Once you
master the fundamentals. in this section, we 're going to look at the module system in node, you
will learn what modules are why we need them and how they work throughout this section. we 'll
explore a feel of the modules built into the core of node, such as operating system file system
events and http. You will also learn how to create your own modules. in the clientside javascript
that we run inside of browsers when we declare a variable or a function that is added to the
global scope. For example. We use this to call a function after a delay like one second two
second, Whatever so this is just part of the standard Javascript. We can use this on the client or
inside of a browser.. In browsers. We have this window object that represents our global scope.
So all the variables and functions that are defined globally. We can access them via this window
objects. in node. We have another object called global so all these functions and objects we
have here are also globally available in node..
Every node application has at least one file or one module which we call a main module. every
file in a node application is considered a module and the variables and functions defined in that
file are scoped to that module. in objectoriented programming terms. We say there are private
they are not available outside that container outside that module. If you want to use a variable or
a function defined in a module outside of that module, you need to explicitly export it and make
it public. in the next lecture you're going to learn how to create and load a module alright. Now
let 's add a new module to this application. So i 'm gon na add a. new file logger dot J s. let 's
imagine we're. going to use one of those remote logging services for login our messages so
there are websites out there. There provide logging as a service. They give us a url and we can
send an. request to that Url to log messages in the cloud.. In real world applications. Every
module might have several variables and functions. We only want to export a subset of these
members to the outside. in our lager module. This url is implementation detail modules do n't
need to know anything about this. They only need to call the log function so we export these
make it public but keep the Url private so i'm gon na delete this last line..
In the recent versions of Javascript, we have the ability to define constants so as a best practice
when loading a module using the required function, it 's better to store the result in a constant.
Like this. there are tools out there that check our Javascript code for errors like that so by using
this constructs properly, we can prevent these errors from happening at runtime. note does not
execute this code directly it wraps it inside of a function and that 's the function you saw so at
runtime. Our code is going to be converted to something like this. the variables and functions we
define in a module are scoped to that module they 're private and not visible from the outside,
but you might be wondering how node does this. Noah Tutorial is the first hour of my complete
note course where you will learn how. to build a real restful Api using Node Express and
MongoDB.. The course is currently 14 hours long and I 'm planning to add more content to it in
the future. You can watch this course as many as many times..

Written for

Course

Document information

Uploaded on
March 4, 2023
Number of pages
1
Written in
2022/2023
Type
SUMMARY

Subjects

$9.39
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
sanskararya1999

Get to know the seller

Seller avatar
sanskararya1999 Exam Questions
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions