2.0.1 • Published 7 years ago

bytes-extra v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bytes-extra

Extend the package 'bytes' to directly perform conversion between units

Installation

  • npm install bytes-extra --save

Usage

All functions from the original package bytes are available.

const bytes = require('bytes-extra')

// as usual
bytes(1024)                  //'1KB'
bytes()                      // null
bytes('1GB')                 // 1073741824

If a string is provided as the first argument and the second argument options contains unit field, an string is returned as the unit conversion result.

bytes('1GB', {unit: 'MB'})   //'1024MB'
2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago