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

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.

主站蜘蛛池模板: 壶关县| 凌源市| 贵阳市| 广南县| 炎陵县| 荥阳市| 磐石市| 云龙县| 沈丘县| 宁夏| 固始县| 和林格尔县| 巴南区| 松阳县| 乌苏市| 泽州县| 石楼县| 沅陵县| 裕民县| 同德县| 汝阳县| 溧水县| 松滋市| 喀什市| 阜新市| 六安市| 通城县| 镇雄县| 宽甸| 临漳县| 民丰县| 和平县| 古田县| 响水县| 南京市| 乐亭县| 饶阳县| 双柏县| 连平县| 弋阳县| 大安市|