Aller au contenu principal

@w5s/byte-size

W5S Byte size manipulation (@w5s/byte-size)

NPM Version License

Installation

npm install @w5s/byte-size

Usage

import { ByteSize } from '@w5s/byte-size';
import { Codec } from '@w5s/core';

export function main() {
const size = ByteSize(123);
console.log(`Size: ${ByteSize.format(size)}`); // Size: 123 B

console.log(Codec.decode(ByteSize, '1 KB')); // ByteSize(1024)
}

License

MIT © Julien Polo julien.polo@gmail.com

Index

Namespaces

Type Aliases

Variables

Type Aliases

ByteSize

ByteSize: ByteSizeType

ByteSizeFormat

ByteSizeFormat: Enum.ValueOf<typeof ByteSizeFormat>

Variables

constByteSizeFormat

ByteSizeFormat: any = ...

Byte size formats

Page Options