@lxfriday/size-transformer

size transformer,from B to TB

Stats

StarsIssuesVersionUpdatedCreatedSize
@lxfriday/size-transformer
101.0.33 years ago3 years agoMinified + gzip package size for @lxfriday/size-transformer in KB

Readme

size-transformer

文件大小单位转换

install

npm i @lxfriday/size-transformer
# or
yarn add @lxfriday/size-transformer

参数

  • size {number} 要转换的文件大小

用法

const transformer = require('@lxfriday/size-transformer');
console.log(transformer(1024 * 1024 * 1024 * 1024)); // 1.00 TB
console.log(transformer(1024)); // 1.00 KB

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.