New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@azury/bytes

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azury/bytes

Convert bytes to human readable size units, and vice versa.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-95.65%
Maintainers
1
Weekly downloads
 
Created
Source

@azury/bytes

Installation

npm i @azury/bytes

Usage

import bytes from '@azury/bytes'

/*
 * Convert bytes to a readable size.
 */

bytes(100) // '100 B'
bytes(25000) // '25 KB'
bytes(50000000) // '50 MB'
bytes(1000000000000) // '1 TB'

bytes(100, { long: true }) // '100 Bytes'
bytes(25000, { long: true }) // '25 Kilobytes'
bytes(50000000, { long: true }) // '50 Megabytes'
bytes(1000000000000, { long: true }) // '1 Terabyte'

bytes(100, { format: 'array' }) // [100, 'B']
bytes(25000, { format: 'array' }) // [25, 'KB']
bytes(50000000, { long: true, format: 'array' }) // [50, 'Megabytes']
bytes(1000000000000, { long: true, format: 'array' }) // [1, 'Terabyte']

/*
 * Convert a readable size to bytes.
 */

bytes('100 B') // 100
bytes('25 KB') // 25000
bytes('50 MB') // 50000000
bytes('1 TB') // 1000000000000

bytes('100 Bytes') // 100
bytes('25 Kilobytes') // 25000
bytes('50 Megabytes') // 50000000
bytes('1 Terabyte') // 1000000000000

Configuration

  • long
  • format: string | array (only available when converting bytes to a readable size)

FAQs

Package last updated on 22 Aug 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc