bytelabel

convert byte lengths into a nice formatted string

Development of this module has been stopped.
Last updated 4 years ago by roryrjb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bytelabel 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.2                                ...           latest (4 years ago)

8 Versions

  • 2.0.2 [deprecated]           ...           4 years ago
  • 2.0.1 [deprecated]           ...           4 years ago
  • 2.0.0 [deprecated]           ...           4 years ago
  • 1.1.1 [deprecated]           ...           5 years ago
  • 1.1.0 [deprecated]           ...           5 years ago
  • 1.0.3 [deprecated]           ...           5 years ago
  • 1.0.2 [deprecated]           ...           5 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 8
This Month 8
Last Day 0
Last Week 0
Last Month 17
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |