Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

filemanagementsystemfornode

whitzscott16ISC1.0.2

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

typescript, nodejs, file-management, file-operations, filesystem, file-utilities, file-wrapper, custom-error-handling, error-handling, rename-file, move-file, copy-file, delete-file, append-content, get-file-info, get-file-metadata, directory-management, list-files, list-directories, recursive-directory-listing, check-file-existence, create-directory, delete-directory, write-file, read-file, file-permissions, file-locking, temporary-files, file-synchronization, data-compression, zip-files, unzip-files, tar-files, gzip-files, decompress-files, encryption, decryption, AES-encryption, RSA-encryption, secure-file-storage, file-checksum, hashing, integrity-check, versioning, file-backups, restore-files, disk-space-analysis, large-file-handling, parallel-file-processing, batch-file-operations, streaming-files, file-chunking, merge-files, split-files, log-file-management, config-file-management, data-parsing, JSON-file-handling, CSV-file-processing, XML-file-processing, YAML-file-handling, binary-file-handling, metadata-parsing, timestamp-retrieval, automatic-renaming, file-classification, machine-learning-file-management, intelligent-search, deep-learning-file-organization, OCR-integration, context-aware-file-operations, predictive-file-management, semantic-search, data-indexing, document-management, enterprise-document-storage, digital-asset-management, file-clustering, graph-based-file-navigation, blockchain-file-storage, IPFS-integration, decentralized-storage, zero-knowledge-storage, edge-computing-file-storage, serverless-file-handling, multi-platform-support, cross-device-sync, remote-file-access, cloud-storage, AWS-S3-integration, Google-Drive-integration, Dropbox-file-sync, OneDrive-integration, real-time-file-collaboration, audit-logging, file-monitoring, system-logging, enterprise-security, GDPR-compliance, HIPAA-compliance, role-based-access, authentication, token-based-access, file-permission-control, multi-threaded-file-processing, big-data-file-storage, scientific-data-storage, financial-records-management, medical-records-storage, legal-document-management, image-processing, video-file-handling, audio-file-management, media-file-organization, game-development-assets, 3D-model-file-storage, metadata-driven-automation, self-healing-filesystem, cloud-native-file-storage, real-time-indexing, AI-assisted-file-organization, smart-file-tagging, voice-search-files, natural-language-file-search, event-driven-file-management, file-change-detection, real-time-backup, incremental-backups, disaster-recovery, customizable-file-rules, workflow-automation, legal-compliance, document-signing, certified-backups, data-lifecycle-management, IoT-data-storage, high-performance-storage, low-latency-file-operations, GPU-accelerated-file-processing, quantum-safe-storage, data-governance, predictive-maintenance, automated-file-classification, cognitive-file-organization, storage-analytics, disk-cleanup, file-defragmentation, distributed-file-storage, collaborative-editing, workflow-management, corporate-file-strategy, AI-powered-file-retrieval, personalized-file-organization, digital-rights-management, secure-document-storage, AI-data-lakes, content-addressable-storage, quantum-computing-file-management, next-gen-filesystems, AI-assisted-search, semantic-file-retrieval, smart-folder-creation, metadata-enrichment, file-recommendation-systems, smart-file-prioritization, auto-scaling-storage, cloud-redundancy, serverless-cloud-backups, backup-automation, block-level-storage, flash-storage-management, database-file-storage, hybrid-cloud-storage, secure-P2P-file-sharing, enterprise-file-distribution, network-file-transfer, deduplication, real-time-stream-processing, interactive-data-visualization, file-query-engine, indexing-engine, clustered-file-storage, automated-tagging, deep-learning-file-classification, context-aware-storage, self-organizing-file-system, real-time-metadata-extraction, cognitive-search, privacy-preserving-file-storage, federated-learning-file-management, privacy-preserving-file-access, content-based-file-search, AI-driven-file-organization, unsupervised-file-clustering, fuzzy-file-search, smart-content-deduplication, intelligent-content-archiving, machine-learning-data-processing, explainable-AI-file-management, natural-language-processing-search, multi-agent-file-management, adaptive-file-storage, contextual-file-retrieval, multi-cloud-storage-integration, quantum-encryption-for-files, AI-assisted-data-migration, secure-data-erasure, policy-driven-storage, self-configuring-filesystem, automated-file-grouping, deep-metadata-analysis, privacy-centric-data-storage, self-learning-file-systems, blockchain-secured-file-storage, digital-identity-file-security, AI-powered-cloud-storage, automated-document-tagging, privacy-enhanced-data-storage, federated-file-sharing, open-source-file-systems, intelligent-document-processing, adaptive-access-control, secure-data-synchronization, intelligent-duplicate-detection, lightweight-file-indexing, policy-driven-file-access, data-governance-framework, large-scale-data-indexing, AI-powered-data-cleaning, high-availability-storage, AI-powered-file-tracking, next-gen-data-management, content-driven-file-navigation, cross-domain-file-access, real-time-digital-archiving, edge-compute-storage, semantic-data-labeling, collaborative-cloud-file-storage, multi-user-file-editing, data-mesh-storage, modular-storage-architecture, enterprise-asset-management, federated-storage-networks, cloud-native-data-protection, composable-file-systems, containerized-file-storage, real-time-streaming-storage

readme


📘 File Management System - TypeScript

A powerful, flexible, and chainable file management system for Node.js.

📘 File Management System - TypeScript

A powerful, flexible, and chainable file management system for Node.js.
This system provides an easy way to manage files and directories while supporting:

  • Custom error handling
  • Custom chainable methods
  • Advanced file operations like compression, metadata retrieval, and content manipulation.

📌 Key Features

🚀 File Operations

Rename, Move, Copy, and Delete files
Append content to files
Retrieve compressed file content (getInfo())
Retrieve file metadata (getMetaInfo())

📂 Directory Operations

Create, Delete, and List directories
Check if a file/folder exists (syncExist())

⚙ Customization & Error Handling

Custom error handling (e.g., auto-create missing files on error)
Add custom chainable methods (addMethod())
Invoke custom chain methods dynamically (invokeMethod())


📥 Installation

To install and use this package, run:

git clone https://github.com/Whitzzscott/FileManagement.git
cd FileManagement
npm install

🛠 Usage Example

This example demonstrates:

  • Error handling: Automatically creating a missing file if an error occurs.
  • Custom chainable methods: Adding a method that logs the file path.
  • File operations: Renaming, moving, copying, appending, and deleting a file.
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());
})();

📜 API Reference

This file management system offers multiple operations for handling files and folders.

📂 File Operations

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")

📁 Directory Operations

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())

📊 File Info & Metadata

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())

⚙ Customization & Error Handling

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")

🔧 How to Use This Project

  1. Install the package
    npm install filemanagementsystemfornode
  2. Run the script
    npm run start
  3. Modify settings
    • Change file paths in src/main.ts to test different operations.
    • Modify core functionality in src/Wrapper if necessary.

📜 License

This project is open-source and free to use.


💡 Future Enhancements

We plan to add:

  • 🔹 File encryption support (AES, RSA encryption for file security)
  • 🔹 File versioning (track changes over time)
  • 🔹 Logging & monitoring system (track operations in a log file)

🚀 Enjoy simplified file management with powerful chaining!
Feel free to suggest new features or improvements! 🎯


👨‍💻 Author

WhitzScott - Developer of the File Management System.
If you have questions or ideas, feel free to reach out!