bytes-formater
v1.0.4
Published
A package to format bytes into human-readable strings
Downloads
55
Maintainers
Readme
formatBytes
Overview
formatBytes
is a lightweight utility function designed to convert bytes into human-readable file sizes. Whether you're working on a web application, a desktop program, or any other project that deals with file sizes, formatBytes
can help you display them in a user-friendly format.
Installation
You can install formatBytes
via npm:
npm install bytes-formater
## Usage --------------
import formatBytes from 'format-bytes';
const fileSize = 1024; // Example byte size
const formattedSize = formatBytes(fileSize);
console.log(formattedSize); // Output: '1 KB'
## How To Use