NodeJs commands

The cd command is the abbreviation of change directory , which means to change the current directory
cls command, clear screen. Clear screen command (CLS, CLear Screen)
tab key, autocomplete.
Up key, prompt for the most recent command
 
in cmd window
Example of starting a node project
cd ProjectRTC/
npm install
above sea level start
npm run dev
 
or
cd to the project directory
1 Install node
cnpm install
 
2 Start or debug
cnpm start (or npm run dev)
3
online:
npm run build
 
Initialize, generate package.json
Change to the project directory, npm init
 
install express
Switch to the project directory and enter npm install --save express
 
Install express-session
Stored in the server's memory
Install: npm install express-session
 
Install template engine ejs
Change to the project directory and enter npm install - -save ejs
 
When creating a new project, create the following empty directory
 
Node.js Manipulating MongoDB
Packages are required:
npm install - -save mongodb
//database reference
var MongoClient = require('mongodb').MongoClient;
 
encrypt and decode
crypto
No need to type commands, directly in the npm package
 
image processing
GraphicsMagick
1. Download and install GraphicsMagick or ImageMagick first
2、npm install gm
 
mongoose
npm install --save mongoose
是一个将JavaScript对象与数据库产生关系的一个框架,object related model。 操作对象,就是操作数据库了;对象产生了,同时也持久化了。
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325047620&siteId=291194637