# Node / Express

Released in 2009 initially for Linux. Node lets developers create serve-side tools and applications in JavaScript. It runs directly on computer compared to being on a browser. It's great to build real-time web apps and lets you use javascript on both side of development. NPM provides thousands of reusable packages.

Released in 2010. Express is the most popular Node web framework. It can write handlers for requests, Intergrate with view rendering engines, set port and request middleware.

expressjs doc (opens new window)

# Backend languages and Frameworks

image-20201215082732487

and Python Django ofcourse

# Companies

image-20201215085810063

Companies that are using Node

image-20201215085345788

# npm init

create a new npm package.

--save can be omitted.

-g installed globally

npm install
// installs all dependencies

npm i
// install's alias

npm i <package name> --save
// saves to dependecy, can be omitted

npm i <package name> --save-dev
// dev dependency

npm i <package name> --global
// installs globally

npm i <package name> -g
// alias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Instead of saving the module being installed and added to package.json as an entry in dependencies, it will save it as an entry in the devDependencies.

dependencies are for use in production. devDependencies are a collection of the dependencies that are used in development of your application - the modules that you use to build it, but don't need to use when it's running. This could include things like testing tools, a local server to speed up your development, and more.

ref: node source (opens new window)

# fs module

access local files

// import
const fs = require("fs");
1
2

# unopionated?

It means there is no one right way to do things that Express will force you into. By contrast an opinionated framework guides/forces you into a specific way to do something. The best example of such is Ruby on Rails ("the Rails Way").

# MVC MVP MVVM unopinionated?

https://academy.realm.io/posts/eric-maxwell-mvc-mvp-and-mvvm-on-android/

https://cocoacasts.com/what-is-wrong-with-model-view-controller

# const var let

Why can I use const on web?

const is only available form es6

# parseInt() vs Number()

parseInt("20px"); // 20
parseInt("10100", 2); // 20
parseInt("2e1"); // 2

// type conversion
Number("20px"); // NaN
Number("2e1"); // 20, exponential notation
1
2
3
4
5
6
7

# What is inside request and response?

# What is a socket

# What is a threadpool?

# Middleware

# templating language

# view engine

# What is port?

# A Name C Name

# DNS

# mvc

Last Updated: 3/1/2021, 9:19:08 PM