
Research
Using Trusted Protocols Against You: Gmail as a C2 Mechanism
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
filemanagementsystemfornode
Advanced tools
A file management system for node.js application making managements of files easier, all in one code, you can delete, move, etc, files all in one code, making ability to manage a system eg a application requiring transfering of files in folders easier
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:
git clone https://github.com/Whitzzscott/FileManagement.git
cd FileManagement
npm install
This example demonstrates:
import { FileWrapper } from "./wrappers/FileWrapper";
const file = new FileWrapper("./testFolder/sample.txt");
// β
Custom error handling: Auto-create missing files when they are not found
file.errorOnFound = (error) => {
if (error.code === "ENOENT") {
file.sync().writeFile("Default content");
console.log(`π File created: ${file.getPath()}`);
}
};
// β
Add a custom method (e.g., logging the file path)
file.addMethod("logPath", function () {
console.log("File is at:", this.getPath());
return this;
});
// β
Chainable file operations
(async () => {
file
.rename("renamed.txt") // Renames file
.invokeMethod("logPath") // Logs new file path
.move("./testFolder/moved") // Moves file to a new folder
.copy("./backup") // Creates a copy in the backup folder
.append("\nMore content added.") // Appends text to the file
.delete(); // Deletes the file
console.log("π Compressed File Content:", file.getInfo());
console.log("π File Metadata:", file.getMetaInfo());
console.log("π Files in directory:", file.list());
})();
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") |
npm install filemanagementsystemfornode
npm 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!
FAQs
A file management system for node.js application making managements of files easier, all in one code, you can delete, move, etc, files all in one code, making ability to manage a system eg a application requiring transfering of files in folders easier
The npm package filemanagementsystemfornode receives a total of 11 weekly downloads. As such, filemanagementsystemfornode popularity was classified as not popular.
We found that filemanagementsystemfornode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fixβa new CLI tool that turns CVE alerts into safe, automated upgrades.