Node.js v18.12.1 documentation


Table of contents

Net#

Stability: 2 - Stable

Source Code: lib/net.js

The node:net module provides an asynchronous network API for creating stream-based TCP or IPC servers (net.createServer()) and clients (net.createConnection()).node:net模块提供了一个异步网络API,用于创建基于流的TCP或IPC服务器(net.createServer())和客户端(net.createConnection())。

It can be accessed using:可以使用以下方式访问:

const net = require('node:net');