Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@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 1 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.