Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@transloadit/prettier-bytes

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transloadit/prettier-bytes

> Even though this module is publicly accessible, we do not recommend using it in projects outside of [Transloadit](https://transloadit.com). We won't make any guarantees about its workings and can change things at any time, we won't adhere strictly to Se


Version published
Weekly downloads
267K
increased by1.34%
Maintainers
4
Weekly downloads
 
Created

What is @transloadit/prettier-bytes?

@transloadit/prettier-bytes is an npm package designed to convert byte values into human-readable strings. It is particularly useful for displaying file sizes in a more understandable format.

What are @transloadit/prettier-bytes's main functionalities?

Convert bytes to human-readable format

This feature allows you to convert a byte value into a human-readable string. For example, 1024 bytes will be converted to '1 kB'.

const prettierBytes = require('@transloadit/prettier-bytes');
console.log(prettierBytes(1024)); // '1 kB'

Handle large byte values

This feature can handle large byte values and convert them into appropriate units. For example, 1048576 bytes will be converted to '1 MB'.

const prettierBytes = require('@transloadit/prettier-bytes');
console.log(prettierBytes(1048576)); // '1 MB'

Customizable output

This feature allows customization of the output format, such as specifying the number of decimal places. For example, 1500 bytes can be converted to '1.50 kB' with two decimal places.

const prettierBytes = require('@transloadit/prettier-bytes');
console.log(prettierBytes(1500, { decimalPlaces: 2 })); // '1.50 kB'

Other packages similar to @transloadit/prettier-bytes

FAQs

Package last updated on 07 May 2024

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