format-file-size
v1.0.0
Published
A simple node.js module that converts bytes into the appropriate size units(Bytes,KB,MB,GB,TB).
Downloads
11
Readme
format-file-size module
A simple node.js module that converts bytes into the appropriate size units(Bytes,KB,MB,GB,TB).
Features
- Converts bytes to human-readable size units. -Supports conversion from bytes up to Terabytes.
Installation
1 Clone the repository or download the module.
git clone https://github.com/Gagandeepkaurgrewal/format-file-size.git
cd format-file-size
npm install format-file-size
# Usage
const formatFileSize = require("./index");
console.log(formatFileSize(1024)); // 1KB
console.log(formatFileSize(1048576)); // 1MB
console.log(formatFileSize(1024000, 1)); // 1000KB