1 of 25

backend

lab i/iix

2 of 25

schedule

Lab I (today)

  1. Node
  2. Server
  3. npm

Assignments

  • Learnyounode
  • Package (feature)
  • Optional assignments

Prerequisites

  • Text editor
  • Subshell
  • Git
  • GitHub
  • Slack
  • Node

3 of 25

node

i/iv

4 of 25

i node

Node.js is an open source project designed to help you write JavaScript programs that talk to networks, file systems, or other I/O (input/output, reading/writing) sources. That’s it! It’s just a simple and stable I/O platform that you are encouraged to build modules on top of.

5 of 25

i node: callbacks

6 of 25

I node: events

7 of 25

I node: streams

8 of 25

I node: modules

9 of 25

NPM

ii/iv

10 of 25

ii npm

npm is a package manager for the JavaScript programming language. It is the default package manager for […] Node.js. It consists of a command line client, also called npm, and an online database of […] packages, called the npm registry.

11 of 25

ii npm

The npm website

12 of 25

ii npm

bash

[examples] $ npm install express

+ express@4.16.2

added 48 packages in 4.476s

[examples] $

You can install packages with npm

13 of 25

ii npm

[examples] $ npm init --yes

Wrote to /Users/tilde/projects/oss/backend/package.json:

{� "name": "backend",� "version": "1.0.0",� "description": "",� "main": "index.js",� "dependencies": {},� "devDependencies": {},� "scripts": {� "test": "echo \"Error: no test\" && exit 1"� },� "keywords": [],� "author": "",� "license": "ISC"�}

bash

You can create packages with npm

14 of 25

"version": "2.5.1"

ii npm

major

minor

patch

15 of 25

"version": "2.5.1"

ii npm

Change

New feature

Bug fix

16 of 25

demo

node & npm

17 of 25

schedule

Assignments

  • Learnyounode

Homework

  • Package (feature)

Lecture II

  1. http
  2. request
  3. server

Lab I (today)

  1. Node
  2. Server
  3. npm

18 of 25

assignments

iii/iv

19 of 25

 learnyounode 

take 1 hour to begin the learnyounode assignment on github

20 of 25

HOMEWORK

iv/iv

21 of 25

 package 

Start working on package in your feature

22 of 25

 package 

take ± 15 minutes to begin the package assignment on github

Note: Make sure you work in your GitHub repo for Block Tech. This will be the foundation for your feature (JS).

23 of 25

 package 

take ± 15 minutes to begin the package assignment on github

Note: Your project will be reviewed and receive feedback.

Expect people to read it and be ready for tips and tops!

24 of 25

coaching sessions on friday!

25 of 25

exit;

see you in lecture ii/xi!