1
00:00:02,150 --> 00:00:07,400
As you learned, Javascript is a hosted language, that means Javascript itself,

2
00:00:07,400 --> 00:00:12,500
the definition of the language can be implemented in different environments.

3
00:00:12,500 --> 00:00:17,760
All you need in the end is a Javascript engine that parses the code and executes it in the end

4
00:00:17,990 --> 00:00:23,660
and one very common environment of course is the browser. Browsers have their own Javascript engines,

5
00:00:23,840 --> 00:00:26,520
like the V8 engine in the case of Chrome

6
00:00:26,600 --> 00:00:32,900
and this in the end hosts and executes the Javascript code therefore. Now togetger with the browser

7
00:00:32,900 --> 00:00:39,200
APIs you learned about, like the DOM or the browser storage or the fetch API and so on,

8
00:00:39,200 --> 00:00:46,190
you got tools to build rich client-side applications where you utilize the language and all its key features

9
00:00:46,190 --> 00:00:47,840
and keywords and so on

10
00:00:47,840 --> 00:00:54,620
combined with the browser APIs to provide the user experience you want to provide, all of that then

11
00:00:54,620 --> 00:01:02,420
runs in the browser, so directly where your users are but of course nothing speaks against taking Javascript

12
00:01:02,600 --> 00:01:04,330
and executing it somewhere else.

13
00:01:04,490 --> 00:01:05,560
We can do that,

14
00:01:05,570 --> 00:01:11,000
we can execute Javascript anywhere else we want by simply taking the Javascript engine and taking it

15
00:01:11,000 --> 00:01:14,030
out of the browser basically and that's it.

16
00:01:14,030 --> 00:01:17,780
We can then add our own APIs if we want to,

17
00:01:17,780 --> 00:01:24,470
so not APIs to work with the DOM for example because if the Javascript engine, if the environment is

18
00:01:24,470 --> 00:01:27,980
detached from the web page, there is no DOM right,

19
00:01:27,980 --> 00:01:32,780
there is no HTML code which we could parse if we run Javascript somewhere else but instead we might

20
00:01:32,780 --> 00:01:38,490
want to add new APIs, APIs which don't exist in the browser, for example to work with the local file

21
00:01:38,490 --> 00:01:42,860
system which is not possible in the browser due to security reasons

22
00:01:43,070 --> 00:01:51,170
and that's exactly what Node.js does. Node.js is essentially the extracted V8 engine Chrome offers enriched

23
00:01:51,170 --> 00:01:55,460
by extra APIs, so its that engine you know from the browser

24
00:01:55,460 --> 00:02:02,180
but basically instead of the browser APIs, it has access to other APIs and it runs outside of the browser,

25
00:02:02,180 --> 00:02:03,960
this is Node.js

26
00:02:04,070 --> 00:02:09,020
and of course this also implies that what you learned about Javascript still is relevant,

27
00:02:09,080 --> 00:02:15,320
just the browser specific parts like the DOM or the browser storage of course are not important when we

28
00:02:15,320 --> 00:02:17,750
work with Javascript outside of the browser.

29
00:02:17,840 --> 00:02:19,850
So let's now have a look at Node.js.
