@azury/bytes
Advanced tools
Changelog
v2.1.0
added support for Deno
import bytes from 'https://deno.gg/bytes'
bytes('25 KB') // 25000
Changelog
v2.0.0
you can now choose your desired prefix.
import bytes from '@azury/bytes'
bytes('25 KiB') // 25*1024
bytes('25 Kibibytes') // 25*1024
bytes(61217, { prefix: 'metric' }) // 61.22 KB
bytes(61217, { prefix: 'binary' }) // 59.78 KiB
bytes(61217) // 61.22 KB