/size-converter

A size converter package which converts bytes into KB, MB, GB.

Primary LanguageJavaScriptMIT LicenseMIT

size-converter

A size converter package which converts bytes, KB, MB, GB.

Install

$ npm i convert-data-size

How to use

Install the package using above command. then import the package like below:

const convertSize = require('convert-data-size');
const c = convertSize(2000);
console.log(c);

//output
2.0 KB

// if input is 0
const c = convertSize(0);
console.log(c);
//output
N/A

Feel free to reach out for any fix and improvement. linkedin : https://www.linkedin.com/in/marut-pandya-a16480131/ twitter: https://twitter.com/pandya_marut