All language subtitles for 004 Using Modules 1_ Core Modules_Downloadly.ir_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Let's keep moving

and explore Node.js some more.

And so let's now actually start a new JavaScript file.

So right in the root folder, and I'm calling it index.js,

let's just decrease the terminal here a little bit.

Okay, so let's now write our very first Node code

here inside a file and all I'm gonna do

is to create a hello variable.

(typing)

And then putting the classic "Hello world" in there.

So "Hello world" has been traditionally used

when starting a new programming language

and that's kind of what we're doing here.

Okay, and now I'm logging to the console

this hello variable, so very very very simple stuff.

Give it a save and let's actually now run this file.

So, in normal JavaScript in a browser,

we would now include this JavaScript file

into some HTML file and then open up

that HTML file in a browser, right?

But here with Node, we don't need to do anything like that.

All we do is to use our Node command.

But now, we're not gonna hit 'Enter' right away,

because that would take us back to the REPL

but instead we want to run this file.

And so all we have to do is to write Node

and then the name of the file, so index.js,

hit 'Enter' and indeed, here we have our log "Hello world."

So congratulations, you just ran

your very first Node script.

Now, that isn't really all that useful, is it?

So let's do something a bit more advanced.

And remember how I said right in the first lecture

that with Node.js, we can do all kinds of amazing things

that we cannot do with JavaScript in the browser

like for example reading files from the file system, right?

Now in order to do that, we need to use a Node module.

So Node.js is really built around this concept of modules

where all kinds of additional functionality

are stored in a module.

And in the case for reading files,

that is inside the FS module.

So how do we open up these modules,

or how can we actually use them?

Well, we do require them into our code and then store

the result of the requiring function in a variable.

So that sounds a bit complicated, so let's simply do it.

So we will call FS to the result

(typing)

of requiring the FS module.

And FS here stands for file system.

So by using this module here, we will get access

to functions for reading data and writing data

right to the file system.

So again, calling this function here with this built-in

FS module name will then return an object

in which there are lots of functions that we can use.

And restore that object right into the FS variable

that we can then later use.

We are going to use it in the next video,

but for now I want to quickly take a look

at the Node documentation with you,

so that in case you need some other module

for yourself later, you always know where

to look up some information about it.

Okay, so the Node documentations are something really,

really important for every Node developer to know about.

So, what we do is to go to nodejs.org

and then hit the documentations tab here

and then select the Node version that you're using

here on the left side.

So I am using version 10, and so

that's the one I'm choosing here.

And so that is the documentation.

Here on the left side, you have all kinds

of different modules.

For example, you have the REPL as well,

so the REPL is what we used in the last lecture

and if you need to know a bit more about it,

well you can come down here and read

whatever you need to know.

For example, the exit that I talked about

is documented here and well, all kinds of stuff.

Okay, you can also actually use the REPL

inside your code, which doesn't make much sense

but is actually possible.

So again all the modules are listed here on the left side

and the one that we just implemented is the file system.

Okay, and so down here you have all this different stuff

that for now will not make much sense to you, okay,

but that's no problem at all.

That's why we have this whole course ahead of us.

For now just know that in case you need anything,

it is always available in the documentation for you.

So for example, in the next video,

we will read a file from the disk to our code.

And we're gonna do that using the read file sync.

And so here you have all the information

about that specific function.

Okay, and so in the next video,

that is actually what we're gonna do.

And in this one, you learned how to write

your own very first Node code inside

of a new JavaScript file, and then run

that file in the terminal.

Then we also required the file system module

and so, again, in the next video,

we will finally use it and import some files.

See you then.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.