Don't have any better name for it :p
It simply helps in calculating bytes and humanizing them.
yarn add bytes-buck
# OR npm install bytes-buck
import byteBuck from 'bytes-buck'
let result = byteBuck(
// Bytes you want to sum
["5 GiB", "12 MiB", "5 GB"],
// Places after decimal, ex. 4.5678 KB
4,
// If true, 4...KB will eb converted to 4...KiB
true
)
Docs can be found here
Contributions, issues and feature requests are welcome!
if you feel that something is missing, feel free to create an Issue.
Almost all the project I make are Open Source.
Do ⭐ this Project.
Made with ❤ and TypeScript.
Byte No. ex. from "12.3 MiB" give 12.3
Byte Type ex. from "12.3 MiB" give "MiB"
Will return TiB (true) or TB (false)
Adds the given Bytes...
Values you would like to add.
No.s after decimal point.
True, if You want output like GiB, TiB, KiB, etc... Else false.
Sum of the given bytes
Converts the Bytes to Human Readable Form
bytes to convert
No.s after decimal point
TiB (true) or TB (false)
ex. 12.2 MiB or MB
Returns True, if value is GiB, TiB or similar... else false
Seperates a Number and String from a give String. ex. "12 MiB", it'll return 12 and MiB
Generated using TypeDoc
Converts a Given Human readable byte to Bytes.