@0leksanderv/file-tools
v1.0.0
Published
  . The main goal is to show how to create your own library for file operations.
The library is in the File_Library.js file and contains functions for:
- Creating files
- Reading files
- Appending text to files
- Checking if files exist
- Creating folders
- Deleting files and folders
Project Structure
task1/
├── File_Library.js # Here are all the library functions
├── index.js # Main file that imports the library
├── package.json # Project configuration
└── README.md # This file with descriptionLibrary Functions
Here is what my library can do:
Working with files:
createFile(filename)- creates a new filereadFile(filename)- reads the file contentappendFile(filename, text)- adds text to the filefileExists(filename)- checks if the file exists
Working with folders:
newFolder(foldername)- creates a new folderdelFolder(foldername)- deletes a folder
Deletion:
delFile(filename)- deletes a filedeleteFileAndFolder(filename, foldername)- deletes the file and then the folder
All functions print messages to the console about success or error.
How to Run on Your PC
To run this project on your computer:
Install Node.js - if you don't have it, download from nodejs.org
Clone or download the project - copy the files to a folder on your computer
Open terminal - go to the project folder (where
package.jsonis)Install dependencies:
npm installThis will install Express (though it's not used, but it's in package.json)
Run the project:
npm startor
node index.js
After running, you will see messages in the console if something works.
Notes
This is my first project, so the code might not be perfect. If you find bugs or want to improve, write to me!
