1.1.2 • Published 5 months ago

drive-file-counter v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

About The Project

The Estimate Files Counter Node.js package allows you to estimate the number of files within a specific drive using a standalone executable. This package leverages an executable to calculate the estimated number of files on any given drive by querying system metadata. The tool is designed for easy integration into any Node.js project, offering a simple API to run file count estimates on local drives (e.g., C:, D:, etc.).

Key Features:

  • Cross-Platform Compatibility: Works on Windows systems where NTFS file system metadata is available.
  • Accurate File Estimates: Uses system-level utilities (fsutil) to gather metadata about the file system and estimates the number of files based on available data.
  • Easy Integration: Simple API for Node.js applications to call, with results returned as JSON.
  • Admin Rights Check: Ensures the script runs with Administrator privileges for system access.

Getting Started

Installation

  1. Install the NPM package:

    npm install drive-file-counter

Usage

Once the package is installed, you can use it in your project by importing and calling the estimateFiles function. Here's an example of how to use it:

import { estimateFiles } from 'drive-file-counter';

estimateFiles('C:', (result) => {
    if (result.success) {
        console.log(`Estimated number of files on drive ${result.drive}: ${result.estimated_files}`);
    } else {
        console.error(`Error: ${result.error}`);
    }
});

Input:

  • drive (String): The drive letter to estimate file count for (e.g., 'C:').

Output:

  • success (Boolean): Whether the operation was successful.
  • drive (String): The drive letter passed as input.
  • estimated_files (Number): The estimated number of files on the drive.
  • error (String, optional): Error message if the operation fails.

Important Notes:

  • Admin Rights: The script requires administrator privileges to execute correctly. Ensure you run your Node.js process with elevated permissions.
  • Supported Platforms: This tool is designed for Windows systems using NTFS. It may not be applicable to other file systems.
1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago