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

Skip to content

Commit 942c44e

Browse files
committed
Rewrote week 3 code
1 parent 4c1815f commit 942c44e

26 files changed

+1652
-2965
lines changed

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Week 3",
11+
"program": "${workspaceFolder}/week3/src/index.js",
12+
"cwd": "${workspaceFolder}/week3"
13+
}
14+
]
15+
}

week1/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "hyf-node-week-1",
33
"version": "1.0.0",
44
"description": "HackYourFuture Node.js Week 1",
5+
"repository": "https://github.com/HackYourFuture/nodejs.git",
56
"main": "src/index.js",
67
"author": "George Sapkin",
78
"license": "MIT",

week2/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# HackYourFuture Node.js - Reading material week 2
44

55
## 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).
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).
77

88
## Today's meal
99
1. Recap last week
@@ -20,8 +20,8 @@ Last week we looked at building an HTTP interface. The interface allowed us to g
2020

2121
### Something about ES6 I want you guys to know
2222
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:
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:
2525

2626
```js
2727
"dependencies": {
@@ -36,26 +36,26 @@ So in summary: if you're working on the frontend, you probably don't want to use
3636
```
3737

3838
### 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)
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)
4242

43-
### 2. NodeJS Process:
44-
Don't have to remember everything in this video, just a nice outline
45-
[Egghead video tutorial](https://egghead.io/lessons/node-js-the-node-js-process-object)
46-
Only read the part about "process.argv"
47-
[Node.JS docs - process.argv](https://nodejs.org/docs/latest/api/process.html#process_process_argv)
43+
### 2. NodeJS Process:
44+
Don't have to remember everything in this video, just a nice outline
45+
[Egghead video tutorial](https://egghead.io/lessons/node-js-the-node-js-process-object)
46+
Only read the part about "process.argv"
47+
[Node.JS docs - process.argv](https://nodejs.org/docs/latest/api/process.html#process_process_argv)
4848

4949
### 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)
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)
5353

5454
### 4. Node Fundamentals
5555
Read parts:
5656
- 3.1, 3.2
5757
- 4.1, 4.3
58-
[Airpair tutorial](https://www.airpair.com/javascript/node-js-tutorial#3-node-fundamentals)
58+
[Airpair tutorial](https://www.airpair.com/javascript/node-js-tutorial#3-node-fundamentals)
5959

6060
## 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)
61+
>You’ll find it here: [Lynda :information_desk_person:](https://www.lynda.com/SharedPlaylist/e8a2fec772bb462da38429629a34f3b7)

week3/.babelrc

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

week3/.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+
}

week3/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
todos.json

week3/actions/create.js

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

week3/actions/index.js

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

week3/actions/list.js

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

week3/actions/remove.js

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

week3/actions/update.js

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

week3/data/todos.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

week3/index.js

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

week3/models/todo.js

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

0 commit comments

Comments
 (0)