Socket
Book a DemoInstallSign in
Socket

tiny-byte-size

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-byte-size

Dead simple, single file, tiny byte formatter

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
967
40.14%
Maintainers
1
Weekly downloads
 
Created
Source

tiny-byte-size

Dead simple, no configuration needed, tiny byte formatter

npm install tiny-byte-size

Usage

const byteSize = require('tiny-byte-size')

console.log(byteSize(100)) // 100B
console.log(byteSize(1000)) // 1kB
console.log(byteSize(1100)) // 1.1kB
console.log(byteSize(10101010)) // 10.1MB
console.log(byteSize.perSecond(10101010)) // 10.1MB/s
console.log(byteSize.perSecond(10101010, 500)) // 20.2MB/s

License

MIT

FAQs

Package last updated on 23 Aug 2022

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