Skip to content

Demonstration of file processing using the Node fs module

Notifications You must be signed in to change notification settings

briandesousa/node-file-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comprehensive Guide to File Processing in Node

This repository contains a comprehensive demonstration of file, directory and link functions provided by the built-in Node.js fs module.

The fs module includes 3 different types of APIs (callback, promise, sync). Examples in this repository are built using the newest, promise-based API. There are a few examples of the callback and sync APIs for comparison purposes.

Usage

Run sudo node index.js to run all examples.

All files, directories and links that are generated by this script are contained in the data folder. The contents of the data folder is reset automatically as required. You can safely re-run this script repeatedly.

The examples in this script are intended to be run in a Linux environment. While they can be run in Windows, several examples will behave differently and even return errors in cases where the Windows file system doesn't support the capability being demonstrated.

Some examples in this script change the ownership of files and directories to the root user and group. If the script is not run with superuser privileges (sudo), those examples will fail with an access error.

This script has been tested on Node.js 16.x.

About

Demonstration of file processing using the Node fs module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published