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

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.

主站蜘蛛池模板: 儋州市| 边坝县| 吴堡县| 榆社县| 江孜县| 肇州县| 梁河县| 宁夏| 高阳县| 太和县| 新河县| 湾仔区| 渭南市| 柳州市| 壶关县| 花垣县| 类乌齐县| 利辛县| 邢台市| 安溪县| 科技| 临高县| 迁安市| 黔西县| 赤峰市| 墨江| 仁化县| 许昌市| 汉阴县| 海安县| 阿勒泰市| 二连浩特市| 调兵山市| 福鼎市| 望江县| 勐海县| 金寨县| 天等县| 邢台市| 临湘市| 青川县|