npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

readable-bytes

1.0.4 • Public • Published

readable-bytes

Build Status

A simple useful util to convert bytes to pretty string with proper or specified unit.

install

npm install readable-bytes --save

or with yarn

yarn add readable-bytes

usage

import readableBytes from 'readable-bytes'
 
// base 10
readableBytes(1000) // 1 KB
readableBytes(1000 * 1000) // 1 MB
readableBytes(1000 * 1000, 'KB') // 1000 KB
 
//base 2
readableBytes(1024, null, 2) // 1KB
readableBytes(1024 * 1024, null, 2) // 1MB
readableBytes(1024 * 1024, 'KB', 2) // 1024 KB

install

npm i readable-bytes

Downloadsweekly downloads

4

version

1.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability