Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 16, 2024 via pnpm

filesize 10.0.12

JavaScript library to generate a human readable String describing the file size
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
8 May 2012
Version published
12 Aug 2023
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
filesize@10.0.12
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of filesize 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does filesize do?

Filesize.js is a handy JavaScript library that provides a convenient way to obtain a human-readable string representing a file size from a number (which could be a float or an integer) or string. It offers a simple way to transform raw size data into a presentation that is comfortable and intuitive for human users to understand.

How do you use filesize?

Using the filesize library in your project is straightforward. First, you need to import the filesize function from the library. The function can be used to convert a number, which represents a file size in bytes, into a human-readable string. For example, you can convert the byte value 265318 into the string "259.1 KB" with the specific standard jedec:

import {filesize} from "filesize";
filesize(265318, {standard: "jedec"}); // Output: "259.1 KB"

The library also supports various configuration options allowing you to customize the output according to your needs. For instance, you can set the base to 2, enable bit sizes, specify the symbol via exponent, activate full form of the measure unit, enable decimal end padding, and plenty more.

The library also provides a partial() function which accepts a configuration object and returns a new function that applies this configuration upon call. This might be useful for reducing object creation in your code.

import {partial} from "filesize";
const size = partial({standard: "jedec"});
size(265318); // Output: "259.1 KB"

Where are the filesize docs?

If you wish to delve deeper into the filesize library's functionality or need more specific details about the configuration options and their defaults, refer to the library's README file on its GitHub page filesize. There is no separate dedicated documentation, as the README itself is comprehensive and includes all necessary details to use the library effectively.