BytesSize
import { BytesSize } from "https://raw.githubusercontent.com/i-xi-dev/bytes.es/4.4.2/deps.ts";
@example
const size = new BytesSize(2_048);
const unit = BytesUnit.KIB;
const kib = size.to(unit);
// kib
// → 2
const format = new Intl.NumberFormat("en", { style: "unit", unit });
const kibStr = format.format(kib);
// kibStr
// → "2 kB"
class BytesSize {}
constructor(byteCount: SafeInteger | bigint);
to(unit: BytesUnit): number;
valueOf(): number;
§Constructors
§
new BytesSize(byteCount: SafeInteger | bigint)
[src]