Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f41a55

Browse files
authored
Merge pull request HackYourFuture#97 from HackYourFuture/more-updates
Updated week 2 lecture example and homework assignment
2 parents d5fd45a + 94db673 commit 7f41a55

File tree

22 files changed

+1497
-89
lines changed

22 files changed

+1497
-89
lines changed

.vscode/launch.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
{
88
"type": "node",
99
"request": "launch",
10-
"name": "Launch Week 1",
11-
"program": "${workspaceFolder}/week1/src/index.js",
12-
"cwd": "${workspaceFolder}/week1"
10+
"name": "Launch Week 1 - Lecture",
11+
"program": "${workspaceFolder}/week1/lecture/src/index.js",
12+
"cwd": "${workspaceFolder}/week1/lecture"
1313
},
1414
{
1515
"type": "node",
1616
"request": "launch",
17-
"name": "Launch Week 2",
18-
"program": "${workspaceFolder}/week2/src/index.js",
19-
"cwd": "${workspaceFolder}/week2"
17+
"name": "Launch Week 2 - Lecture",
18+
"program": "${workspaceFolder}/week2/lecture/src/index.js",
19+
"cwd": "${workspaceFolder}/week2/lecture"
2020
},
2121
{
2222
"type": "node",
2323
"request": "launch",
24-
"name": "Launch Week 3",
25-
"program": "${workspaceFolder}/week3/src/index.js",
26-
"cwd": "${workspaceFolder}/week3"
24+
"name": "Launch Week 3 - Lecture",
25+
"program": "${workspaceFolder}/week3/lecture/src/index.js",
26+
"cwd": "${workspaceFolder}/week3/lecture"
2727
}
2828
]
2929
}

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,30 @@ developer".
1111

1212
| Week | Topic | Read | Homework |
1313
| ---: | ------------------ | --------------------------------- | ------------------------------------------- |
14-
| 0. | Introduction | [Week 0 Reading](week0/README.md) | None |
1514
| 1. | Node.js, npm, http | [Week 1 Reading](week1/README.md) | [Week 1 Homework](week1/homework/README.md) |
1615
| 2. | fs, process | [Week 2 Reading](week2/README.md) | [Week 2 Homework](week2/homework/README.md) |
1716
| 3. | express, REST | [Week 3 Reading](week3/README.md) | [Week 3 Homework](week3/homework/README.md) |
1817

18+
## Watch before your first Node.js session
19+
20+
Watch Jason's playlist on [Lynda.com](https://www.lynda.com/SharedPlaylist/a850f6b7bddf437f8b98679f5f9d9cc3) (45 min)
21+
22+
And you can start with the [Node.js Tutorial for Beginners](https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp)
23+
24+
## Promises' refresher
25+
26+
Jim's [summary of promises](https://github.com/remarcmij/JavaScript/blob/master/fundamentals/promises.md)
27+
from JavaScript module.
28+
29+
## Node.js Setup
30+
31+
We're going to use the latest Node.js LTS 8.x. Follow one of the following
32+
instructions depending on your operating system:
33+
34+
* [CentOS/Fedora/RHEL](https://github.com/nodesource/distributions#rpminstall)
35+
* [Debian/Ubuntu](https://github.com/nodesource/distributions#debinstall)
36+
* [macOS](https://nodejs.org/en/download/)
37+
* [Windows](https://nodejs.org/en/download/)
1938

2039
## Pre-requisites
2140

@@ -55,12 +74,12 @@ There are two reasons why we at HYF chose Node.js over others:
5574

5675
## Handing in homework
5776

58-
A Video to remind you about [how we hand in homework](https://www.youtube.com/watch?v=-o0yomUVVpU&index=2&list=PLVYDhqbgYpYUGxRdtQdYVE5Q8h3bt6SIA).
77+
Take a look at [this video](https://www.youtube.com/watch?v=-o0yomUVVpU)
78+
made by Daan, he explains how your homework needs to be handed in from now on.
5979

6080
Also review the [Git workflow material](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md)
6181
and use it as a reference.
6282

63-
6483
## Rewatch previous lectures
6584

6685
- Lecture 1 (Joost): https://www.youtube.com/watch?v=c8OvRVsbIsc

week0/README.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

week1/README.md

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# HackYourFuture Node.js - Reading material week 1
1+
# HackYourFuture Node.js Week 1
22

33
## Agenda
44

@@ -7,25 +7,36 @@
77
3. Questions & answers (Q&A)
88
4. What is Node.js?
99
5. Finding documentation
10-
6. Setting up a Node.js project using `npm init` and `package.json`
11-
7. Installing dependencies using `npm install`
10+
6. Read-eval-print loop (REPL)
11+
7. Setting up a Node.js project using `npm init` and `package.json`
12+
8. Installing dependencies using `npm install`
1213
1. Local and global mode
13-
8. Importing modules using `require`
14+
9. Importing modules using `require`
1415
1. Built-in, external modules and local files
15-
9. Building an HTTP server using built-in `http` module
16+
10. Building an HTTP server using built-in `http` module
1617
1. HTTP request methods
1718
2. HTTP response status codes
18-
10. Homework
19+
3. Routing
20+
4. Example
21+
11. Homework
1922

2023
## What is Node.js?
2124

22-
From Node.js' [website]()https://nodejs.org/en/:
25+
From Node.js' [website](https://nodejs.org/en/):
2326

2427
> Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
2528
> Node.js uses an event-driven, non-blocking I/O model that makes it lightweight
2629
> and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of
2730
> open source libraries in the world.
2831
32+
Videos:
33+
34+
[Introduction to Node.js](https://www.youtube.com/watch?v=w-7RQ46RgxU&index=1&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp)
35+
36+
[The V8 Engine](https://www.youtube.com/watch?v=86tgU7UaJmU&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=3).
37+
38+
Reading:
39+
2940
[What is Node.js? What can you do with it? Why should you use it?](https://medium.com/@paynoattn/what-is-nodejs-what-can-you-do-with-it-why-should-you-use-it-8c8d6df32d6d#.qvbp8g4dq)
3041
_estimated time: 10 minutes_
3142

@@ -41,8 +52,20 @@ _estimated time: 4-6 hours_
4152

4253
[Node.js Documentation](https://nodejs.org/docs/latest-v8.x/api/documentation.html)
4354

55+
## Read-eval-print loop (REPL)
56+
57+
[REPL](https://nodejs.org/docs/latest-v8.x/api/repl.html)
58+
4459
## Setting up a Node.js project using `npm init` and `package.json`
4560

61+
Videos:
62+
63+
[Node Package Manager](https://www.youtube.com/watch?v=kQ1j0rEI7EI&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=20)
64+
65+
[The package.json File](https://www.youtube.com/watch?v=_eRwjuIDJ2Y&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=21)
66+
67+
Documentation:
68+
4669
[`npm init`](https://docs.npmjs.com/cli/init)
4770

4871
[`package.json`](https://docs.npmjs.com/files/package.json)
@@ -53,20 +76,34 @@ _estimated time: 4-6 hours_
5376

5477
## Importing modules using `require`
5578

79+
Videos:
80+
81+
[Modules and `require()`](https://www.youtube.com/watch?v=xHLd36QoS4k&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=6)
82+
83+
[Module Patterns](https://www.youtube.com/watch?v=9UaZtgB5tQI&index=7&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp)
84+
85+
Documentation:
86+
5687
[Node.js modules](https://nodejs.org/docs/latest-v8.x/api/modules.html)
5788

5889
## Building an HTTP server using built-in `http` module
5990

91+
Videos:
92+
93+
[Clients & Servers](https://www.youtube.com/watch?v=qSAze9b0wrY&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=11)
94+
95+
[Creating a Server](https://www.youtube.com/watch?v=lm86czWdrk0&index=12&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp)
96+
97+
[Basic Routing](https://www.youtube.com/watch?v=_zvWeGwVkCY&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp&index=19)
98+
99+
Documentation:
100+
60101
[`http` module documentation](https://nodejs.org/docs/latest-v8.x/api/http.html)
61102

62103
[HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
63104

64105
[HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
65106

66-
## Homework
67-
68-
Check [README.md](homework/README.md) in `homework` subdirectory.
69-
70107
## Control flow and events
71108

72109
An important term when making applications is _control flow_. You already know
@@ -75,6 +112,10 @@ all about it. Read through this page and answer this question: how do we control
75112

76113
Read: [Examples of control flow in JavaScript](https://github.com/ummahusla/Codecademy-Exercise-Answers/tree/master/Language%20Skills/JavaScript/Unit%2005%20Control%20Flow/01%20More%20on%20Control%20Flow%20in%20JS)
77114

115+
## Homework
116+
117+
Check [README.md](homework/README.md) in `homework` subdirectory.
118+
78119
## Prepare for the next lecture
79120

80121
[Custom made playlist :boom: Lynda.com](https://www.lynda.com/SharedPlaylist/a034fd969ef945bb9ebbd9490cc75d5a)

week1/homework/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# HackYourFuture Node.js - Homework week 1
1+
# HackYourFuture Node.js Week 1 - Homework
22

3-
# Setup
3+
## Setup
44

55
Follow these instructions to set up your environment.
66

7-
## 1. Fork this repository and clone it to your hard drive
7+
### 1. Fork this repository and clone it to your hard drive
88

99
Follow the general homework instructions for this.
1010

11-
## 2. Install dependencies
11+
### 2. Install dependencies
1212

1313
Change to the directory where you've cloned this repository, then to
1414
`week1/homework` directory and finally install dependencies using `npm`.
@@ -19,7 +19,7 @@ cd week1/homework
1919
npm install
2020
```
2121

22-
## 3. Run the project from that directory
22+
### 3. Run the project from that directory
2323

2424
```bash
2525
node .

week2/README.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,60 @@
1-
# HackYourFuture Node.js - Reading material week 2
2-
3-
## Last weeks Summary
4-
5-
Last week we looked at building an HTTP interface. The interface allowed us to
6-
get a state, and manipulate the state (add, subtract, reset).
1+
# HackYourFuture Node.js Week 2
72

83
## Agenda
94

105
1. Recap last week
116
2. Previous homework
127
3. Questions & answers (Q&A)
138
4. Persisting data beyond the lifetime of the app
9+
1. Accessing file system using build-in `fs` module
10+
2. Example
1411
5. Building a command line interface (CLI)
15-
6. Accessing file system with Node.js `fs` module
16-
7. CRUD operations, create, read, update and delete
17-
8. Homework
12+
1. Accessing command line arguments using `process.argv`
13+
2. Example
14+
6. CRUD operations, create, read, update and delete
15+
7. Homework
1816

19-
## Reading material
17+
## Last week's summary
2018

21-
### Node.js process
19+
Last week we looked at building an HTTP server. That server allowed us to get a
20+
state and manipulate it (add, subtract, reset).
2221

23-
You don't have to remember everything in this video, just a nice outline
24-
[Egghead video tutorial](https://egghead.io/lessons/node-js-the-node-js-process-object)
25-
Only read the part about "process.argv"
26-
[Node.JS docs - process.argv](https://nodejs.org/docs/latest/api/process.html#process_process_argv)
22+
## Reading material
2723

2824
### Node.js file system module `fs`
2925

26+
Videos:
27+
28+
[Reading & Writing Files](https://www.youtube.com/watch?v=U57kU311-nE&index=9&list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp)
29+
30+
Documentation:
31+
3032
[Main documentation](https://nodejs.org/docs/latest-v8.x/api/fs.html)
3133

3234
[fs.readFile()](https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_readfile_path_options_callback)
35+
3336
[fs.appendFile()](https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_appendfile_file_data_options_callback)
3437

38+
### Building a command line interface (CLI)
39+
40+
[Understand the Node.js process object](https://egghead.io/lessons/node-js-understand-the-node-js-process-object)
41+
You don't have to remember everything in this video, it's just a nice outline.
42+
43+
[Node.js Process Documentation](https://nodejs.org/docs/latest-v8.x/api/process.html)
44+
45+
[process.argv](https://nodejs.org/docs/latest-v8.x/api/process.html#process_process_argv)
46+
47+
### CRUD
48+
49+
[CRUD](https://en.wikipedia.org/wiki/Create%2C_read%2C_update_and_delete)
50+
3551
### Node Fundamentals
3652

37-
Read parts:
38-
- 3.1, 3.2
39-
- 4.1, 4.3
40-
[Airpair tutorial](https://www.airpair.com/javascript/node-js-tutorial#3-node-fundamentals)
53+
Read parts 3.1, 3.2, 4.1, 4.3 of [Airpair tutorial](https://www.airpair.com/javascript/node-js-tutorial#3-node-fundamentals)
54+
55+
## Homework
56+
57+
Check [README.md](homework/README.md) in `homework` subdirectory.
4158

4259
## Prepare for the next lecture
4360

week2/homework/.eslintrc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"extends": "standard",
7+
"rules": {
8+
"brace-style": [
9+
"warn",
10+
"stroustrup",
11+
{
12+
"allowSingleLine": true
13+
}
14+
],
15+
"curly": [
16+
"off"
17+
],
18+
"generator-star-spacing": [
19+
"warn",
20+
{
21+
"after": true,
22+
"before": false
23+
}
24+
],
25+
"key-spacing": [
26+
"off"
27+
],
28+
"max-len": [
29+
"warn",
30+
80
31+
],
32+
"no-multi-spaces": [
33+
"off"
34+
],
35+
"semi": [
36+
"error",
37+
"always"
38+
],
39+
"space-before-function-paren": [
40+
"warn",
41+
"never"
42+
],
43+
"standard/array-bracket-even-spacing": [
44+
"off"
45+
],
46+
"standard/object-curly-even-spacing": [
47+
"off"
48+
],
49+
"template-tag-spacing": [
50+
"off"
51+
]
52+
}
53+
}

week2/homework/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)