🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

bytelabel

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytelabel

convert byte lengths into a nice formatted string

latest
Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
13
-45.83%
Maintainers
1
Weekly downloads
 
Created
Source

bytelabel Build Status js-standard-style

Convert byte lengths into a nice formatted string.

Installation

$ npm install bytelabel

Test:

$ npm test

Usage/API

bytelabel(number)

The only argument takes a number assumes that this value is in bytes and returns the size more nicely formatted.

Examples:

var bytelabel = require('bytelabel')

// Parsed values

bytelabel(123)      // => '123 B'
bytelabel(4398)     // => '4.29 KB'
bytelabel(22323445) // => '21.28 MB'

// Rounding

bytelabel(123, {round: true})       // => '123 B'
bytelabel(4398, {round: true})      // => '4 KB'
bytelabel(22323445, {round: true})  // => '21 MB'

License

MIT

Keywords

byte

FAQs

Package last updated on 06 Sep 2015

Did you know?

Socket

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.

Install

Related posts