New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bytes-i18n

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytes-i18n

Work with bytes; format, convert..

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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.

Keywords

bytes

FAQs

Package last updated on 06 Jun 2014

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