
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@transloadit/prettier-bytes
Advanced tools
> 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
@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.
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'
The 'filesize' package is another popular library for converting byte values into human-readable strings. It offers more customization options compared to @transloadit/prettier-bytes, such as different output formats (e.g., string, array, object) and support for binary (IEC) and decimal (SI) units.
The 'pretty-bytes' package is a lightweight library for converting bytes into human-readable strings. It is similar to @transloadit/prettier-bytes in terms of functionality but offers additional features like locale support and the ability to handle negative byte values.
Even though this module is publicly accessible, we do not recommend using it in projects outside of Transloadit. We won't make any guarantees about its workings and can change things at any time, we won't adhere strictly to SemVer.
This module is maintained from a monorepo called monolib.
Adapted from https://github.com/Flet/prettier-bytes/ Changing 1000 bytes to 1024, so we can keep uppercase KB vs kB ISC License (c) Dan Flettre https://github.com/Flet/prettier-bytes/blob/master/LICENSE
FAQs
> 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
The npm package @transloadit/prettier-bytes receives a total of 433,970 weekly downloads. As such, @transloadit/prettier-bytes popularity was classified as popular.
We found that @transloadit/prettier-bytes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.