Node.js Documentation
A comprehensive guide to understanding and working with Node.js.
Node.js Documentation
Welcome to the Node.js documentation. This guide will help you understand and work with Node.js.
Table of Contents
- Basic Concepts
- Core Modules
- NPM Commands
- File System Operations
- HTTP Server
- Asynchronous Programming
- Error Handling
- Environment Variables
Basic Concepts
| Concept | Description |
|---|---|
| Node.js | JavaScript runtime built on Chrome’s V8 JavaScript engine |
| Event-driven | Uses non-blocking I/O model that makes it lightweight and efficient |
| NPM | Node Package Manager for installing and managing dependencies |
| package.json | Configuration file that contains metadata about the project |
| Modules | Reusable blocks of code that can be imported/exported |
Core Modules
| Module | Description |
|---|---|
fs | File system operations |
http | HTTP server and client functionality |
path | Utilities for working with file and directory paths |
os | Operating system-related utility methods |
events | For handling and emitting events |
util | Utility functions |
stream | For working with streaming data |
crypto | Cryptographic functionality |
NPM Commands
| Command | Description |
|---|---|
npm init | Initialize a new Node.js project |
npm install <package> | Install a package |
npm install -g <package> | Install a package globally |
npm install --save-dev <package> | Install as a development dependency |
npm uninstall <package> | Uninstall a package |
npm update | Update packages |
npm list | List installed packages |
npm run <script> | Run a script defined in package.json |
File System Operations
Package Manager
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.