A lightweight, dependency-free JavaScript library for converting file sizes to human-readable formats with multiple standards support.
file-size is a JavaScript library that converts raw byte counts into human-readable file size strings. It supports multiple measurement standards (IEC, SI, JEDEC) and provides a simple API for formatting file sizes in applications running on Node.js or in browsers.
JavaScript developers who need to display file sizes in user interfaces, logs, or reports, particularly those working on file management tools, dashboards, or system monitoring applications.
Developers choose file-size for its zero-dependency design, support for multiple file size standards, and straightforward chainable API that works identically in Node.js and browser environments.
📂 Lightweight filesize to human-readable / proportions w/o dependencies for node.js & browsers.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library has no external dependencies, making it lightweight and easy to integrate without bloating project size, as explicitly stated in the features section.
Supports IEC, SI, and JEDEC specifications through methods like human() and to(), allowing flexible formatting for different technical or regional requirements.
Offers a jQuery-like chainable interface, enabling method chaining for multiple operations, as demonstrated in usage examples like filesize(bytes).human().
Provides options such as 'fixed' for decimal precision and 'spacer' for number-unit separation, allowing tailored output without extra code.
Lacks built-in locale-aware formatting for number separators or unit translations, which can be a limitation for global applications.
Only handles byte-to-string conversion without advanced features like file size aggregation, streaming support, or binary prefix beyond the three standards.
The chainable API might be overkill for simple use cases, adding slight overhead compared to a single-function approach for basic conversions.