Home  >  Article  >  Web Front-end  >  nodejs basic knowledge

nodejs basic knowledge

高洛峰
高洛峰Original
2017-02-04 10:40:001262browse

What is nodejs?

node.js is a platform based on the Chrome javaScript runtime, which is used to easily build network applications with fast response speed and easy expansion. (But nodejs is not a javascript application, nodejs is written in c++ language)

js is a scripting language, and scripting languages ​​require a parser to run. For JS written in HTML pages, the browser acts as a parser. For JS that needs to run independently, nodejs is a parser.

Each parser is a running environment that can do the following things:

1. Allow JS to define various data structures and perform operations;

2. Allow JS uses built-in objects and methods provided by the runtime environment.

Example: The purpose of JS running in the browser is to operate the DOM, and the browser provides built-in objects such as document.

The purpose of JS running in nodejs is to operate disk files or build HTT servers. Nodejs accordingly provides built-in objects such as fs and http.

nodejs features:

1. It is a JavaScript running environment

2. Relies on the Chrome V8 engine for code interpretation

3. Event-driven

4. Asynchronous I/O (non-blocking I/O)

5. Events and callbacks (lightweight, scalable, suitable for real-time data interaction applications)

6 .Single process single thread

7.Cross-platform

The above is the entire content of this article. I hope that the content of this article can bring some help to everyone's study or work, and I also hope for your support. PHP Chinese website!

For more articles related to nodejs basic knowledge, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:nodejs basic applicationNext article:nodejs basic application