bi

bytes-i18n

Work with bytes; format, convert..

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

NPM

bytes-i18n

Work with bytes; format, convert.

Usage

var b = require('bytes-i18n');

console.log(b(8566540000));
// result -> 7.98gb

// French example translation
var i18nBytesConf = {
    "b":"o",
    "kb":"Ko",
    "mb":"Mo",
    "gb":"Go",
    "tb":"To"
};

console.log(b(8566540000,i18nBytesConf));
// result -> 7.98Go

console.log("Bytes : "+ b("8GB"));
// result -> 8589934592

console.log("Bytes : "+ b("8gb"));
// result -> 8589934592

If you want to convert in bytes, you need to use default i18n in your code. (not case sensitive)

  • kb / mb / gb /tb

Versions

v 0.0.2 - 2014/06/06

  • If i18n not used, default i18n is restored.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100