A, Node Development Overview
Node is an environment based on JavaScript code that runs Chrome V8 engine.
1.1 Why learn basic server-side development
- And back-end programmers can more closely fit
- Website business logic front, front-end technology needs to learn the back-end technical support (Ajax)
- Broaden the horizons of knowledge, be able to look at a higher perspective of the project
1.2 server-side development of things to do
- Implement business logic websites
- Deletions data change search
1.3 Why Node
- Back-end application development using JavaScript syntax
- Ecosystem active, there are plenty of open source libraries available
- Front-end development tools are mostly based Node Development
Two, Node operating environment to build
Official website: https: //nodejs.org/en/
download and install the appropriate version.
Check whether the installation was successful, use the cmd command - input "node -v" View version
Three, Node.js Quick Start
Consisting of 3.1 Node.js
JavaScript consists of three parts, ECMAScript, DOM, BOM.
Node.js is some additional API provided by ECMAScript and Node components of the environment, including file, network, path, and so some of the more powerful API.
3.2 Node.js basic grammar
all ECMAScript syntax can be used in Node environment.
Executing code in Node environment, using Node command suffix .js files can be
3.3Node.js test:
(1) First, open the Windows Powershell
input "node" node into the development mode, enter the JavaScript statement, enter: console.log ( "hello node")
(2) Open the JS file a 01.helloworld.js, the
content is 01.helloworld.js
var first = 'hello nodejs';
console.log(first);
Open Windows Powershell, switch to the directory using the cd command,
or in the file directory, hold down the shift right-click, click the Open Windows Powershell window, change into the directory.
Input: Node ./01.helloworld.js
(input file name may be input in the previous section, the tab key press auto completion)