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

Skip to content

Commit bd9ef2e

Browse files
committed
Updating documentation
1 parent a68a065 commit bd9ef2e

File tree

4 files changed

+104
-63
lines changed

4 files changed

+104
-63
lines changed

week1/MAKEME.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Assignment
44

5-
Create an http server that can add and subtract from a number, which we will
5+
Create an HTTP server that can add and subtract from a number, which we will
66
call `state`. Use project in `week1` directory as starting material.
77
Pay extra attention to line 21, which contains some hints for this week
88
`console.log('New http request received', request.url);`
@@ -67,9 +67,9 @@ Read: http://callbackhell.com/
6767
Video: https://www.youtube.com/watch?v=e1Ln1FrLvh8
6868
Read: http://openmymind.net/2012/2/3/Node-Require-and-Exports/
6969

70-
### `http`, listen
70+
### `http`, `listen`
7171
- Video basic: https://www.youtube.com/watch?v=pYOltVz7kL0
72-
- Video routing: https://www.youtube.com/watch?v=_D2w0voFlEk (please focus on request.url, not request.method)
72+
- Video routing: https://www.youtube.com/watch?v=_D2w0voFlEk (please focus on `request.url`, not `request.method`)
7373
- Read: [Node.js documentation about `http`](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/)
7474
- Read Advanced:
7575

week1/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
will dominate the web development world. Instead, it’s a platform that fills a
55
particular need."
66

7+
## Agenda
8+
9+
1. Recap last week
10+
2. Previous homework
11+
3. Questions & Answers (Q&A)
12+
4. What is Node.js?
13+
5. Setting up a Node.js project using `npm init`
14+
6. Importing modules using `require`
15+
5. Building an HTTP server using built-in `http` module
16+
1. HTTP methods
17+
2. HTTP status codes
18+
8. Homework
19+
720
### What is Node.js?
821

922
[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)
@@ -14,14 +27,10 @@ _estimated time: 10 minutes_
1427
Tutorials: [NPM tutorials. Follow chapters 1 - 10](https://docs.npmjs.com/getting-started/installing-node)
1528
_estimated time: 4-6 hours_
1629

17-
### Asynchronous callbacks
18-
19-
Although most of this was already covered by the JavaScript class, let's refresh
20-
our memories on Callbacks.
30+
### Promises' refresher
2131

22-
Read: [Understanding Asynchronous JavaScript Callbacks Through Household Chores
23-
](https://medium.freecodecamp.com/understanding-asynchronous-javascript-callbacks-through-household-chores-e3de9a1dbd04#.8ilr4a7aj)
24-
_estimated time: ~1 hour_
32+
Jim's [summary of promises](https://github.com/remarcmij/JavaScript/blob/master/fundamentals/promises.md)
33+
from JavaScript module.
2534

2635
### Control flow and events
2736

week2/MAKEME.md

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,72 @@
1-
> Please help us improve and share your feedback! If you find better tutorials or links, please share them by opening a Pull Request.
2-
31
# HackYourFuture Node.js - Homework week 2
42

53
## Assignment for this week
4+
65
These are the specs for this week's assignment:
7-
- The user can run a NodeJs to-do app
8-
- The user can be able to run the file using node index.js
9-
- There should be a "help" section that lists all the commands for how to use the app
6+
7+
- The user can run a Node.js to-do app
8+
- The user must be able to run the file using `node index.js`
9+
- There should be a "help" section that lists all the commands for how to use
10+
the app
1011

1112
The following commands should be present:
12-
- No command: show help section (`node index.js`)
13-
- help: show help section (`node index.js help`)
14-
- list: show current todo's, or show an appropriate text if there are no todos (`node index.js list`)
15-
- add: add a todo item. all the words behind "add" are entered as 1 todo item to the list (`node index.js add "Buy groceries"`)
16-
- remove: remove a todo item by its 1-base index. (`node index.js remove 2`)
17-
- reset: remove all todo items from the list (`node index.js reset`)
1813

19-
- *BONUS:* update: update a todo item with new text (`node index.js update 3 "Wash teeth"`)
14+
### No command or `help`
15+
16+
Shows help section
17+
18+
```
19+
node index.js
20+
```
21+
22+
or
23+
24+
```
25+
node index.js help
26+
```
27+
28+
### `list`
29+
30+
Shows current to-dos, or shows an appropriate text if there are no to-dos
31+
32+
```
33+
node index.js list
34+
```
35+
36+
### `add`
37+
38+
Adds a to-do item. All the words behind `add` are entered as 1 to-do item to the
39+
list.
40+
41+
```
42+
node index.js add "Buy groceries"
43+
```
44+
45+
### `remove`
46+
47+
Removes a to-do item by its 1-base index, e.g. to remove second item, execute:
48+
49+
```
50+
node index.js remove 2
51+
```
52+
53+
### `reset`
54+
55+
Removes all to-do items from the list:
56+
57+
```
58+
node index.js reset
59+
```
60+
61+
### *BONUS:* `update`
62+
63+
Updates a to-do item with new text:
64+
65+
```
66+
node index.js update 3 "Wash teeth"
67+
```
68+
69+
### Things to consider
2070

21-
### Consider this:
2271
- What representation you use in your file (CSV, TSV, JSON, ...)
2372
- Handle edge cases, i.e. control what happens if user enters unexpected input

week2/README.md

Lines changed: 23 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,44 @@
1-
> Please help us improve and share your feedback! If you find better tutorials or links, please share them by opening a Pull Request.
2-
31
# HackYourFuture Node.js - Reading material week 2
42

53
## Last weeks Summary
6-
Last week we looked at building an HTTP interface. The interface allowed us to get a state, and manipulate the state (add, subtract, reset).
74

8-
## Today's meal
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).
7+
8+
## Agenda
9+
910
1. Recap last week
10-
2. Homework
11+
2. Previous homework
1112
3. Questions & Answers (Q&A)
12-
4. Other topics
13-
4. Persisting data beyond the lifetime of the app.
14-
5. Building a Command Line Interface / Working with arguments
15-
6. Using Node.JS's FileSystem (FS)
13+
4. Persisting data beyond the lifetime of the app
14+
5. Building a command line interface (CLI)
15+
6. Accessing file system with Node.js `fs` module
1616
7. CRUD operations
17-
8. This week's assignment
17+
8. Homework
1818

1919
## Reading material
2020

21-
### Something about ES6 I want you guys to know
22-
You may hear us talking about this "ES6" all the time. ES6 basically means: the latest version of JavaScript. It has a lot of really nice new features that makes life as developer easier. For you guys, you should remember the following:
23-
> During the NodeJS course, we will teach you some ES6 features, like Fat Arrow. It's *extremely* important to know whether a function comes from ES6 or from an older version of JavaScript. Why? [Because browsers don't support every new feature just yet](http://kangax.github.io/compat-table/es6/). With Node, on the other hand, you can always control which version of Javascript is running, because it's running on your computer, not in the browser. Node Version 6.x that you are running supports most ES6.
24-
So in summary: if you're working on the frontend, you probably don't want to use es6 just yet. In backend, type node --version to see which version you are running, and make sure everyone on the team has the same version by adding "engine" to `package.json` like so:
25-
26-
```js
27-
"dependencies": {
28-
...
29-
},
30-
"devDependencies": {
31-
...
32-
},
33-
"engines": {
34-
"node": ">=6.5.0" // this means you need 6.5 or higher
35-
},
36-
```
37-
38-
### 1. ES6: Fat Arrow functions
39-
This is one example of how ES6 can help us write cleaner code. I'm adding this as first reading material because it's used a lot on the NodeJS documentation website, so it's a good idea to understand what this means. Bonus points if you write your callbacks this way.
40-
[Blogpost Sitepoint]([https://www.sitepoint.com/es6-arrow-functions-new-fat-concise-syntax-javascript/)
41-
[Video]([https://www.youtube.com/watch?v=J85lRtO_yjY)
42-
43-
### 2. NodeJS Process:
44-
Don't have to remember everything in this video, just a nice outline
21+
### Node.js process:
22+
23+
You Don't have to remember everything in this video, just a nice outline
4524
[Egghead video tutorial](https://egghead.io/lessons/node-js-the-node-js-process-object)
4625
Only read the part about "process.argv"
4726
[Node.JS docs - process.argv](https://nodejs.org/docs/latest/api/process.html#process_process_argv)
4827

49-
### 3. NodeJS FS
50-
Only read the part about readFile, appendFile (you will need this in your assignment)
51-
[Node.JS docs - fs.readFile](https://nodejs.org/api/fs.html#fs_fs_readfile_file_options_callback)
52-
[Node.JS docs - fs.appendFile](https://nodejs.org/api/fs.html#fs_fs_appendfile_file_data_options_callback)
28+
### Node.js file system module `fs`
29+
30+
[Main documentation](https://nodejs.org/docs/latest-v8.x/api/fs.html)
31+
32+
[fs.readFile()](https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_readfile_path_options_callback)
33+
[fs.appendFile()](https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_appendfile_file_data_options_callback)
34+
35+
### Node Fundamentals
5336

54-
### 4. Node Fundamentals
5537
Read parts:
5638
- 3.1, 3.2
5739
- 4.1, 4.3
5840
[Airpair tutorial](https://www.airpair.com/javascript/node-js-tutorial#3-node-fundamentals)
5941

6042
## As you finish that up, don’t forget to watch next week’s video playlist to prepare for Express.
61-
>You’ll find it here: [Lynda :information_desk_person:](https://www.lynda.com/SharedPlaylist/e8a2fec772bb462da38429629a34f3b7)
43+
44+
You’ll find it here: [Lynda :information_desk_person:](https://www.lynda.com/SharedPlaylist/e8a2fec772bb462da38429629a34f3b7)

0 commit comments

Comments
 (0)