SizeParse3
sizeParse3 is a JavaScript utility function designed to convert human-readable file size strings into a numeric byte count. It accepts both decimal (SI) and binary (IEC) prefixes, enabling inputs such as "1.5 GB", "2 GiB", or "800 MB" to be interpreted as the corresponding number of bytes. The function is commonly used in configuration parsers, CLI tools, and applications that accept user-specified size limits or quotas.
SizeParse3 is the third iteration in the sizeParse family, offering improved robustness and flexibility over its
API and usage: sizeParse3(input, options) returns the number of bytes as a Number. Options may include base:
See also: sizeParse, unit parsing libraries, file size parsing in computing. This article describes a general-purpose