YouTip LogoYouTip

Nodejs Buildin Modules

Node.js built-in modules are core functional modules that come with the Node.js runtime and can be used without additional installation. These modules provide basic system functions such as file operations, network communication, process management, etc., and are the fundamental tools for Node.js development. Unlike third-party modules that need to be installed via npm, built-in modules can be loaded directly using the `require()` function, for example: const fs = require('fs');// File System Module const http = require('http');// HTTP Module * * * ## Introduction to Common Built-in Modules Below is a detailed description and functional overview of Node.js main built-in modules. | Module Name | Description | Common Classes/Methods | Typical Uses | | --- | --- | --- | --- | | [**fs** (File System)](#) | File system operations | `readFile`, `writeFile`, `mkdir`, `readdir`, `createReadStream`, `createWriteStream` | File read/write, directory operations | | **(#)** | Handle file paths | `join`, `resolve`, `dirname`, `basename`, `extname` | Cross-platform path handling | | **(#)** | HTTP server/client | `createServer`, `request`, `get` | Create web server/client | | **(#)** | HTTPS server/client | `createServer`, `request` | Create secure web services | | **(#)** | URL parsing and handling | `parse`, `format`, `URL` class | URL parsing and construction | | **(#)** | Query string handling | `parse`, `stringify` | Handle URL query parameters | | **(#)** | Operating system information | `cpus`, `freemem`, `totalmem`, `homedir`, `hostname` | Get system information | | **(#)** | Event handling | `EventEmitter`, `on`, `emit`, `once` | Custom event system | | **(#)** | Stream operations | `Readable`, `Writable`, `Duplex`, `Transform`, `pipe` | Handle data streams | | **(#)** | Cryptographic functions | `createHash`, `createCipher`, `createDecipher`, `randomBytes` | Encryption/decryption/hashing | | **(#)** | Compression/decompression | `createGzip`, `createGunzip`, `createDeflate`, `createInflate` | Data compression/decompression | | **(#)** | Utility functions | `promisify`, `inherits`, `format`, `types` | Utility functions | | **(#)** | Child process management | `exec`, `execFile`, `spawn`, `fork` | Create child processes | | **(#)** | Cluster management | `fork`, `isMaster`, `isWorker` | Multi-process load balancing | | **(#)** | Domain name resolution | `lookup`, `resolve`, `reverse` | Domain name resolution | | **(#)** | Module for handling multiple asynchronous operation errors | `create`, `run`, `add` | Provides a mechanism to group multiple different I/O operations and handle their errors uniformly. | | **(#)** | Network operations | `createServer`, `connect`, `Socket` | TCP server/client | | **(#)** | UDP datagrams | `createSocket`, `send`, `bind` | UDP communication | | **(#)** | Line-by-line reading | `createInterface`, `on('line')` | Command line interaction | | **(#)** | Interactive interpreter | `start`, `context` | Create REPL environment | | **(#)** | Virtual machine | `runInContext`, `createContext`, `Script` | Execute JavaScript code | | **(#)** | Assertion testing | `equal`, `strictEqual`, `deepEqual`, `throws` | Unit test assertions | | **(#)** | Binary data handling | `Buffer`, `alloc`, `from`, `concat` | Handle binary data | | **(#)** | Console output | `log`, `error`, `time`, `timeEnd` | Debug output | | **(#)** | Timers | `setTimeout`, `setInterval`, `setImmediate`, `clearTimeout` | Scheduled tasks | | **(#)** | Performance monitoring | `performance`, `PerformanceObserver` | Performance measurement | | **(
← Nodejs Path ModuleJs Async Await β†’