{"library":"bytes","type":"library","category":null,"description":"The `bytes` package (current stable version 3.1.2) is a focused JavaScript utility designed for converting human-readable byte strings (e.g., \"1KB\", \"5.5GB\") into their numerical byte equivalents, and vice-versa. It provides a simple, unified API that delegates to a `format` function for converting numbers to strings and a `parse` function for converting strings or numbers to bytes. A key differentiator is its strict adherence to powers of two for unit conversions (e.g., 1KB equals 1024 bytes), which is critical for accurate storage and memory calculations, distinguishing it from decimal-based systems. While major releases are not frequent, the library is stable and widely used, typically receiving updates for bug fixes or minor enhancements. It supports various units including B, KB, MB, GB, TB, and PB, and offers formatting options such as decimal places, thousands separators, and custom unit separators.","language":"javascript","status":"active","version":"3.1.2","tags":["javascript","byte","bytes","utility","parse","parser","convert","converter"],"last_verified":"Wed May 27","install":[{"cmd":"npm install bytes","imports":["import bytes from 'bytes';","import bytes from 'bytes';\nconst formatted = bytes.format(1024);","const bytes = require('bytes');\nconst parsed = bytes.parse('1KB');"]},{"cmd":"yarn add bytes","imports":[]},{"cmd":"pnpm add bytes","imports":[]}],"homepage":null,"github":"https://github.com/visionmedia/bytes.js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/bytes","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/bytes/compatibility"}}