Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@azury/byte
Advanced tools
import byte from 'https://deno.land/x/byte@v3.3.0/byte.ts'
npm i @azury/byte
// ESM
import byte from '@azury/byte'
// CommonJS
const byte = require('@azury/byte')
<script src="https://cdn.jsdelivr.net/npm/@azury/byte@3.3.0"></script>
/*
* Convert bytes to a readable size.
*/
byte(100) // '100 B'
byte(25000) // '25 KB'
byte(50000000) // '50 MB'
byte(1000000000000) // '1 TB'
byte(100, { long: true }) // '100 Bytes'
byte(25000, { long: true }) // '25 Kilobytes'
byte(50000000, { long: true }) // '50 Megabytes'
byte(1000000000000, { long: true }) // '1 Terabyte'
byte(100, { format: 'array' }) // [100, 'B']
byte(25000, { format: 'array' }) // [25, 'KB']
byte(50000000, { long: true, format: 'array' }) // [50, 'Megabytes']
byte(1000000000000, { long: true, format: 'array' }) // [1, 'Terabyte']
// binary prefix
byte(25 * 1024, { prefix: 'binary' }) // '25 KiB'
byte(25 * 1024, { long: true, prefix: 'binary' }) // '25 Kibibytes'
/*
* Convert a readable size to bytes.
*/
byte('100 B') // 100
byte('25 KB') // 25*1000
byte('50 MB') // 50*1000*1000
byte('1 TB') // 1000*1000*1000*1000
byte('100 Bytes') // 100
byte('25 Kilobytes') // 25*1000*1000
byte('50 Megabytes') // 50*1000*1000
byte('1 Terabyte') // 1000*1000*1000*1000
// binary prefix
byte('25 Kibibytes') // 25*1024
byte('50 Mebibytes') // 50*1024*1024
byte('1 Tebibyte') // 1*1024*1024*1024
string
| array
binary
| metric
FAQs
A disk unit conversion library for JavaScript.
The npm package @azury/byte receives a total of 4 weekly downloads. As such, @azury/byte popularity was classified as not popular.
We found that @azury/byte demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.