<commit_before>[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.png)](http://travis-ci.org/avoidwork/filesize.js)
# filesize.js

filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string.  An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output. An optional third parameter lets you disable `bit` sizes, e.g. "Kb".

## Examples

```javascript
filesize(500);                    // "3.91 Kb"
filesize(500, true);              // "3.9k"
filesize(1500);                   // "1.46 KB"
filesize("1500000000");           // "1.40 GB"
filesize("1500000000", 0);        // "1 GB"
filesize(1212312421412412);       // "1.08 PB"
filesize(1212312421412412, true); // "1.1P" - shorthand output, similar to "ls -h"
filesize(265318, 2, false)        // "259.10 KB" - disabled `bit` sizes with third argument
```<commit_msg>Updating example in README<commit_after>[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.png)](http://travis-ci.org/avoidwork/filesize.js)
# filesize.js

filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string.  An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output. An optional third parameter lets you disable `bit` sizes, e.g. "kb".

## Examples

```javascript
// 0.10.0 switched to base 10, all previous versions use base 2
filesize(500);                    // "4.00 Kb"
filesize(500, true);              // "4.0k"
filesize(1500);                   // "1.50 KB"
filesize("1500000000");           // "1.50 GB"
filesize("1500000000", 0);        // "2GB"
filesize(1212312421412412);       // "1.21 PB PB"
filesize(1212312421412412, true); // "1.1P" - shorthand output, similar to "ls -h"
filesize(265318, 2, false)        // "265.32 kB" - disabled `bit` sizes with third argument
```
{'fraction_non_alphanumeric': 0.1385390428211587, 'fraction_numerical': 0.09722921914357682, 'mean_word_length': 2.9404761904761907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '997042', 'n_tokens_mistral': 766, 'n_tokens_neox': 626, 'n_words': 208}