This is the 12th day of my participation in the August More Text Challenge. For details, see: August More Text Challenge
Persistence is the key to study, notes are the soul, review the old to know new, from time to time, review the knowledge points, deepen memory, twice the result with half the effort!
Here are some notes about learning Node.js, accumulated over time
More on that in the future, let’s check it out
Recall — the process of visiting a page
What is itNode.JS
Node.js is a JavaScript runtime environment based on Chrome’S V8 engine. Node.js uses an event-driven, non-blocking asynchronous I/O model, making it lightweight and efficient.
-
Node.js can be written in JavaScript
- Reading and writing files,
- Execute the child process,
- Network communication
-
Node.js handles highly concurrent projects efficiently
Node.js’s package manager, NPM, is the largest open source ecosystem in the world.
How to makenode.js
Run, that’s calledjavascript
Operating environment:
- 1. Open the cli
cmd
- 2, input
node
Command to enternode
Environment can be writtenjs
code - 3. Press and hold twice
ctrl+c
(or.exit
) out of thenode
Operating environment of
Node.js is a javascript runtime environment, and a browser is a javascript runtime environment.
-
The operating environment of the browser
- There’s a security mechanism
- Cannot call the underlying interface file
- Cannot implement file or directory creation, etc
- You can recognize it in the browser
dom
和bom
object
-
The use of the node. Js
- The underlying interface file can be invoked
- You can also create files or directories
node
Not in the environmentbom
和dom
The concept of
3. Why studynode.js
- 1. A front end engineer who doesn’t end up is not a good front end
- 2, many front-end tools are used
node
In order to use these tools well, you have to learnnode
- 3,
node
You can create a server that is a back-end language - In April,
node
You can call very low-level interfacesnode
You can write desktop applications - 5,
node
You can write to the operating system
4. Install node
Website: Download Node
Node. Js: https://nodejs.org…
Version selection:
LTS
The long-used versioncurrent
The latest version- Nodejs Version: Major version Minor version Patch version
- Odd version Unstable version used for testing
- Even version Stable version
Official documents:
Read the documentation. It’s very well written
- nodejs.org/api/
- Nodejs.org/en/docs/gui…
- Chinese documentation: http://nodejs.cn/api/
Set upnode
Server:
- 1. Create one
node
Project directory - 2. Create one
js
file - 3. Run this
js
File, how to run: through the command linecd
To access the directory throughNode file name.js
performJs file
Note: whenever the server code changes, you must restart the server (quit the original server to start).
If you start a new server, you must first shut down the server you started (there is a hot update tool called Nodemen).
Request server procedure:
5. What is NPM
After installing Node.js, NPM will also be installed.
NPM is a node package management repository, a website, and a command.
You can use NPM to easily access a vast library of JavaScript tools on the web
Read more
Read more:
【Github】 Multi-person Collaboration (2)
【Github】 Basic use (1),
[Git] Code version control – Git Introduction & Basic operation (1)
[Node.js] Building an Automated development environment – Basic introduction, [Tool Preparation], [Start], [Detailed Steps (4)], [Module Processing Tool (5)], [Modular Programming Understanding],
The following update preview, keep up with the rhythm, step by step
Next, we’ll learn more about Node.js’ package management tool, NPM. Blunt duck!!!!! xdm
Improve development efficiency and empower our development efficiency!
Keep up with the pace of progress, forward refueling
Come on!! go~