
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@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.
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.