-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass1.js
More file actions
48 lines (41 loc) · 1.68 KB
/
class1.js
File metadata and controls
48 lines (41 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
//Node is an open-source cross-platform runtime environment
//open source - on github, you can contribute to it
//cross-platform runtime environment -
//event-driven architecture
//non-blocking input/output API
//why use node?
//asynchronous event driven IO
//using multiple APIs, one might come before another, or data might not have arrived yet and you need that data before you can move on and do something with it
//concurrency is a lot of things happening at the same time
//node is javascript! if you want to be able to run things outside of your browser environment, you use node
//we have a node application on our hard drive that runs our javascript for us without a browser!!
//node applications don't know what a window object is
//this means you can't use event listeners on node because it isn't connected to a window
//node uses the V8 engine, used by google chrome
//who uses node?
//paypal
//linkedin
//mozilla
//when to use node
//great when you need high levels of concurrency but don't need a lot of CPU time
//nothing with heavy calculations
//great for:
//chat applications
//game servers
//collaborative environments
//ad servers
//streaming services
//how is node different than front-end javascript?
//js with a server attached
//server waits for a request, has some input/output logic, and then sends a response
//two main pieces inside of node
//modules and callbacks
//modules
//this comes in ES7
//very important in node!
//node ships with almost nothing in it
//the front end is an observer pattern to node which is a module pattern
//2 main pieces to a module pattern
//require() and exports
//in order to use node or NPM modules, you first need to import it using require() function
//