1.0.0 • Published 2 months ago

@nishar_khorajiya/filesize-converter v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

convert-file-size

A lightweight Node.js package for file size conversion

Installation

npm install filesize-converter 

Usage

Here's an example of how to use the filesize-converter package:

// Require the filesize-converter package
const filesizeConverter = require('filesize-converter');

// Convert bytes to kilobytes
console.log(filesizeConverter.bytesToKilobytes(1024)); // Output: 1

// Convert bytes to megabytes
console.log(filesizeConverter.bytesToMegabytes(1048576)); // Output: 1

// Convert bytes to gigabytes
console.log(filesizeConverter.bytesToGigabytes(1073741824)); // Output: 1

License

License: Apache-2.0