55 lines
855 B
Plaintext
55 lines
855 B
Plaintext
|
||
nodejs 是让js运行在后端的一个运行环境
|
||
|
||
js 运行在客户端浏览器
|
||
|
||
js 可以运行在后端
|
||
|
||
|
||
nodejs
|
||
|
||
c++
|
||
|
||
v8
|
||
|
||
nodejs 本意 是让 js 成为后端语言,node_modules
|
||
|
||
typescript + nodejs ==== java
|
||
|
||
主要应用场景
|
||
|
||
开发前端
|
||
|
||
gulp webpack vue
|
||
|
||
模块
|
||
|
||
nodejs 内置模块
|
||
第三方模块 npm 包管理工具 https://www.npmjs.com/
|
||
|
||
java maven gradle
|
||
php com
|
||
python pip
|
||
|
||
|
||
nodejs
|
||
|
|
||
|
|
||
deno typescript(js) Rust(c++)
|
||
|
||
nodejs
|
||
package.json 文件 用来描述这个项目的配置和依赖等信息
|
||
|
||
npm init 初始化一个新的 package.json
|
||
npm init -y
|
||
|
||
npm install(i) 下载一个模块
|
||
|
||
--save-dev -D 将模块安装到开发环境下 devDependencies
|
||
--save -S 将模块安装到正式环境下 dependencies
|
||
-g 全局安装
|
||
|
||
npm run 命令名称 运行一个命令
|
||
|
||
|
||
nodejs nw.js electron.js |