官术网_书友最值得收藏!

The Basics of Node.js

Node.js is an event-driven, server-side JavaScript environment. Node.js runs JS using the V8 engine developed by Google for use in their Chrome web browser. Leveraging V8 allows Node.js to provide a server-side runtime environment that compiles and executes JS at lightning speeds.

Node.js runs as a single-threaded process that acts upon callbacks and never blocks on the main thread, making it high-performing for web applications. A callback is basically a function that is passed to another function so that it can be called once that function is done. We will look into this in a later topic. This is known as the single-threaded event loop model. Other web technologies mainly follow the multithreaded request-response architecture.

The following diagram depicts the architecture of Node.js. As you can see, it's mostly C++ wrapped by a JavaScript layer. We will not go over the details of each component, since that is out of the scope of this chapter.

Node's goal is to offer an easy and safe way to build high-performance and scalable network applications in JavaScript.

主站蜘蛛池模板: 确山县| 鹤峰县| 晋城| 兴安县| 德庆县| 北票市| 永吉县| 临夏县| 封丘县| 乌拉特后旗| 宿松县| 商都县| 泾源县| 彝良县| 锡林郭勒盟| 白河县| 乌兰浩特市| 五家渠市| 隆昌县| 泗洪县| 朝阳区| 通许县| 海淀区| 乐清市| 马山县| 上思县| 云浮市| 黄龙县| 台州市| 平度市| 宁南县| 宜川县| 高台县| 娱乐| 明溪县| 页游| 乌海市| 东光县| 新郑市| 遂川县| 永春县|