Skip to main content

utils.prettybytes.options.bits

Home > @nipem/utils > PrettyBytes > Options > bits

PrettyBytes.Options.bits property

Format the number as bits instead of bytes. This can be useful when, for example, referring to bit rate.

Signature:
readonly bits?: boolean;

Example

import { prettyBytes } from '@nipem/utils';
P(1337, {bits: true});
//=> '1.34 kbit'