Size-X
Human readable file size library.
Installing
yarn add size-x # npm install size-x
Usage
const size = ; const v1 = ; // 1Bconst v2 = ; // 1Kconst v3 = ; // 0.01Kconst v4 = ; // 1兆const v5 = ; // 512M sizethreshold = 512;const v6 = ; // 0.5Gsize; // size.threshold = 1000; sizeunits = 'B' 'KiB' 'MiB' 'GiB' 'TiB' 'PiB' 'EiB' 'ZiB' 'YiB';const v7 = ; // 1MiBsize; // size.units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] sizeunits = '字节' '千字节' '兆字节' '吉字节' '太字节' '拍字节' '艾字节' '泽字节' '尧字节';const v8 = ; // 1兆字节size; // size.units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] sizestandard = 'SI';sizeunits = 'B' 'KB' 'MB' 'GB' 'TB' 'PB' 'EB' 'ZB' 'YB';const v9 = ; // 1MBsize; // size.units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] sizegap = ' ';const v10 = ; // 1 Gsize; // size.gap = ''