Gathering detailed insights and metrics for filemanagementsystemfornode
Gathering detailed insights and metrics for filemanagementsystemfornode
npm install filemanagementsystemfornode
Typescript
Module System
Node Version
NPM Version
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
174
Last Day
1
Last Week
13
Last Month
174
Last Year
174
Latest Version
1.0.2
Package Id
filemanagementsystemfornode@1.0.2
Unpacked Size
38.16 kB
Size
8.21 kB
File Count
13
NPM Version
11.1.0
Node Version
22.14.0
Published on
Mar 02, 2025
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-91.9%
13
Compared to previous week
Last Month
0%
174
Compared to previous month
Last Year
0%
174
Compared to previous year
2
A powerful, flexible, and chainable file management system for Node.js.
A powerful, flexible, and chainable file management system for Node.js.
This system provides an easy way to manage files and directories while supporting:
✔ Rename, Move, Copy, and Delete files
✔ Append content to files
✔ Retrieve compressed file content (getInfo()
)
✔ Retrieve file metadata (getMetaInfo()
)
✔ Create, Delete, and List directories
✔ Check if a file/folder exists (syncExist()
)
✔ Custom error handling (e.g., auto-create missing files on error)
✔ Add custom chainable methods (addMethod()
)
✔ Invoke custom chain methods dynamically (invokeMethod()
)
To install and use this package, run:
1git clone https://github.com/Whitzzscott/FileManagement.git 2cd FileManagement 3npm install
This example demonstrates:
1import { FileWrapper } from "./wrappers/FileWrapper"; 2 3const file = new FileWrapper("./testFolder/sample.txt"); 4 5// ✅ Custom error handling: Auto-create missing files when they are not found 6file.errorOnFound = (error) => { 7 if (error.code === "ENOENT") { 8 file.sync().writeFile("Default content"); 9 console.log(`📄 File created: ${file.getPath()}`); 10 } 11}; 12 13// ✅ Add a custom method (e.g., logging the file path) 14file.addMethod("logPath", function () { 15 console.log("File is at:", this.getPath()); 16 return this; 17}); 18 19// ✅ Chainable file operations 20(async () => { 21 file 22 .rename("renamed.txt") // Renames file 23 .invokeMethod("logPath") // Logs new file path 24 .move("./testFolder/moved") // Moves file to a new folder 25 .copy("./backup") // Creates a copy in the backup folder 26 .append("\nMore content added.") // Appends text to the file 27 .delete(); // Deletes the file 28 29 console.log("📄 Compressed File Content:", file.getInfo()); 30 console.log("📑 File Metadata:", file.getMetaInfo()); 31 console.log("📂 Files in directory:", file.list()); 32})();
This file management system offers multiple operations for handling files and folders.
Method | Description | Example |
---|---|---|
rename(newName: string) | Renames the file | file.rename("newName.txt") |
move(destination: string) | Moves the file to a new directory | file.move("./newFolder") |
copy(destination: string) | Copies the file to a new location | file.copy("./backup") |
delete() | Deletes the file permanently | file.delete() |
writeFile(content: string) | Writes new content to the file (overwrites existing content) | file.writeFile("Hello, world!") |
append(content: string) | Appends new content to the file | file.append("\nNew content") |
Method | Description | Example |
---|---|---|
syncExist() | Checks if a file or folder exists | if (file.syncExist()) {...} |
sync() | Ensures the directory exists (creates it if missing) | file.sync() |
list() | Lists all files in the directory | console.log(file.list()) |
Method | Description | Example |
---|---|---|
getInfo() | Reads and compresses the entire file content | console.log(file.getInfo()) |
getMetaInfo() | Retrieves metadata such as size, creation date, and modification date | console.log(file.getMetaInfo()) |
Method | Description | Example |
---|---|---|
errorOnFound = (error) => {...} | Custom error handling (e.g., auto-create files) | file.errorOnFound = (err) => {...} |
addMethod(name, method) | Adds a custom chainable method | file.addMethod("customMethod", function () {...}) |
invokeMethod(name, ...args) | Calls a custom method dynamically | file.invokeMethod("customMethod") |
1npm install filemanagementsystemfornode
1npm run start
src/main.ts
to test different operations.src/Wrapper
if necessary.This project is open-source and free to use.
We plan to add:
🚀 Enjoy simplified file management with powerful chaining!
Feel free to suggest new features or improvements! 🎯
WhitzScott - Developer of the File Management System.
If you have questions or ideas, feel free to reach out!
No vulnerabilities found.
No security vulnerabilities found.