Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdennour/pretty-size
https://github.com/abdennour/pretty-size
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/abdennour/pretty-size
- Owner: abdennour
- Created: 2017-03-27T10:37:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T11:41:28.000Z (almost 8 years ago)
- Last Synced: 2024-11-02T06:45:32.560Z (3 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - pretty-size
README
[![Build Status](https://travis-ci.org/abdennour/pretty-size.svg?branch=master)](https://travis-ci.org/abdennour/pretty-size)
[![Coverage Status](https://coveralls.io/repos/github/abdennour/pretty-size/badge.svg?branch=master)](https://coveralls.io/github/abdennour/pretty-size?branch=master)# Overview :
Display human readable file size .
# Install
```bash
npm install pretty-size --save;
```# Example :
```js
const {prettySize} = require('pretty-size');
// import {prettySize} from 'pretty-size'; // ES6/ES7prettySize(454434343)
//'433.4 MiB'
prettySize(454434343,true)
//'454.4 MB'
prettySize(134343,true)
//'134.3 kB'
prettySize(1024*1024)
//'1.0 MiB'
prettySize(1024*1024*1024*1024,true)
//'1.1 TB'
prettySize(1024*1024*1024*1024,false)```
# License:
MIT .