A command-line filesystem utility built with Node.js that allows users to create, read, write, append, rename, and delete files, as well as create, list, and delete directories directly from the terminal.
- Create files
- Read file contents
- Overwrite file contents
- Append content to files
- Delete files
- Rename files
- Create directories
- List directory contents
- Delete empty directories
Run the CLI using:
git clone ...
cd node-filesystem-cli
npm install
npm startnode app.js create notesCreates a file named notes.txt.
node app.js read notesReads and displays the contents of notes.txt.
node app.js write notes "Hello from Node.js"Overwrites the existing contents of notes.txt.
node app.js append notes "This is additional content"Appends content to notes.txt.
node app.js delete notesDeletes notes.txt.
node app.js mkdir projectsCreates a directory named projects.
node app.js lsLists the contents of the current working directory.
node app.js rename old newRenames old.txt to new.txt.
node app.js rmdir projectsDeletes the projects directory.
- Node.js
- JavaScript
- Node.js File System (
fs) module
This project was built to practice Node.js fundamentals, including command-line arguments, CommonJS modules, asynchronous filesystem operations, callbacks, error handling, closures, and command dispatch.