About 10,500 results
Open links in new tab
  1. File system | Node.js v23.11.0 Documentation

    All file system operations have synchronous, callback, and promise-based forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). Promise-based operations return a promise that is fulfilled when the asynchronous operation is complete.

  2. Node.js File System - GeeksforGeeks

    Jan 8, 2025 · The fs (File System) module in Node.js provides an API for interacting with the file system. It allows you to perform operations such as reading, writing, updating, and deleting files and directories, which are essential for server-side applications and scripts.

  3. Node.js File System Module - W3Schools

    The Node.js file system module allows you to work with the file system on your computer. To include the File System module, use the require() method: var fs = require('fs');

  4. Writing files with Node.js

    1 day ago · The easiest way to write to files in Node.js is to use the fs.writeFile() API. Alternatively, you can use the synchronous version fs.writeFileSync(): You can also use the promise-based fsPromises.writeFile() method offered by the fs/promises module: By default, this API will replace the contents of the file if it does already exist.

  5. How To Work with Files using the fs Module in Node.js

    Sep 9, 2020 · In this article, you will use the fs module to read a file created via the command line, create and write to a new file, delete the file that you created, and move the first file into a different folder.

  6. How to use the fs module in Node - GeeksforGeeks

    Jun 3, 2024 · Some of the most commonly used functions include: fs.readFile(): Reads the contents of a file asynchronously. fs.writeFile(): Writes data to a file asynchronously, replacing the file if it already exists. fs.appendFile(): Appends data to …

  7. Efficiently read files in Node.js with the fs module

    Apr 22, 2025 · Let's explore how to read files effectively using the modern Promises API, older callback methods, synchronous approaches, and streams for large files. Introduction to file reading in Node.js. Node.js provides the fs (file system) module, allowing you to interact with the file system directly from your code. Whether you're reading configuration ...

  8. File System: Node.js `fs` Module - DEV Community

    Aug 24, 2024 · The fs (File System) module in Node.js is a powerful tool for working with the file system, allowing you to interact with files and directories on your server. It's built into Node.js, so you don't need to install anything extra to use it.

  9. Node.js File System Module with Practical Examples

    Jan 22, 2025 · Node.js applications often need to interact with files for tasks like: Storing data. Reading configuration files. Logging application activity. Serving files dynamically (e.g., images or documents). The fs module makes these tasks easy and efficient with its built-in methods. To use the fs module, you need to import it in your script:

  10. Node.js File System (fs module) - Diginode

    The fs module in Node.js is a versatile tool for interacting with the file system. It provides a wide range of methods for reading, writing, and manipulating files and directories. By understanding both synchronous and asynchronous operations, as well as advanced topics like file watching and promise-based methods, you can build robust and ...

  11. Some results have been removed
Refresh