LEARNING JAVASCRIPT - Trang 309

Some core modules, such as

process

and

buffer

, are global, are always available, and

do not require an explicit

require

statement. The core modules are listed in

Table 20-2

.

Table 20-2. Core modules

Module

Global Description

assert

No

Used for testing purposes.

buffer

Yes

For input/output (I/O) operations (primarily file and network).

child_process

No

Functions for running external programs (Node and otherwise).

cluster

No

Allows you to take advantage of multiple processes for performance.

crypto

No

Built-in cryptography libraries.

dns

No

Domain name system (DNS) functions for network name resolution.

domain

No

Allows grouping of I/O and other asynchronous operations to isolate errors.

events

No

Utilities to support asynchronous events.

fs

No

Filesystem operations.

http

No

HTTP server and related utilities.

https

No

HTTPS server and related utilities.

net

No

Asynchronous socket-based network API.

os

No

Operating system utilities.

path

No

Filesystem pathname utilities.

punycode

No

Encoding of Unicode using a limited ASCII subset.

querystring

No

Utilities for parsing and constructing URL querystrings.

readline

No

Interactive I/O utilities; primarily used for command-line programs.

smalloc

No

Allows for explicit allocation of memory for buffers.

stream

Yes

Stream-based data transfer.

string_decoder

No

Converts buffers to strings.

Core Modules, File Modules, and npm Modules | 285

Liên Kết Chia Sẽ

** Đây là liên kết chia sẻ bới cộng đồng người dùng, chúng tôi không chịu trách nhiệm gì về nội dung của các thông tin này. Nếu có liên kết nào không phù hợp xin hãy báo cho admin.