熟悉任务
typescript, nodejs, framwork: nestjs
express
docker
nodejs
一.nodejs是什么
node js 是什么? 使js在浏览器以外的位置(服务器)运行的运行时环境。
v8引擎,js是解释型语言,使用时一边编译一边运行会很慢,所以用了v8引擎
WebKit本身包含两部分主要内容,一部分是做Html渲染的,另一部分是做JavaScript解析的。在Chrome中,只有Html的渲染采用了WebKit的代码,而在JavaScript上,重新搭建了一个NB哄哄的V8引擎。
二.nodejs原理
- event loop 来操作非阻塞
worker pool来操作阻塞io或者cpu密集型任务
- event driven
- asynchronous :提供了非阻塞io的api,和事件驱动(鼠标点击)一个原理。
三. why might we need node?
- multi-purpose technology: These can range from traditional lightweight, high-traffic chat applications to command-line tools and web servers
- the community has already built more than a million modules and libraries for node.js and published them on the node package manager(npm).Developers can easily download and integrate these modules into their existing projects;
四.try it
- REPL(read-eval-print loop) mode cmd中输入node即可
- node xxx.js
javascript
一. what is javascript
- originally designed to programmatically interact with elements of a web page
- is c-like language ;was designed with java in mind
- dynamically typed;compiled JIT(just run it so it can be compiled)
二. where is javascript
everywhere
- webbrowers
- node
- native applications(using electron,react native and nativeScript);
三.javaScript on the client vs server
client means webbrowers(mostly) and native applications
- script tag or specify src attribute
- reach dom
but on server
reading file or databse
install nodejs so that we can excute them
no dom but has packages(有些nodejs内置,有些npm找) using to building web services
四. building your toolbox
- vscode
- extensions:eslint(find and fix problems in your java script code before it hits production); Prettier(automatic code formatter) ;JavaScript(Es6) code snippets(avoid redundant typing with shortcuts)
- nodejs