1.0.0 • Published 5 months ago
jy-format-file-length v1.0.0
安装
npm i jy-format-file-length --save
引入方式
import { formatFile } from 'jy-format-file-length'
功能说明
格式化文件大小
使用示例
// 示例
console.log(formatFile(1024)) // '1.0 KB'
console.log(formatFile(1024 * 1024)) // '1.0 MB'
console.log(formatFile(1024 * 1024 * 1024)) // '1.0 GB'
1.0.0
5 months ago