bytes-compare
v0.0.1
Published
bytes-compare
Downloads
13
Readme
bytes-compare
Browsers support
| IE / Edge | Firefox | Chrome | Safari | iOS Safari | Opera | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE8+ Edge+ | last 10 versions | last 10 versions | last 2 versions | last 2 versions | last 2 versions |
Install
npm i bytes-compare -S
build with rollup
npm run build
use
const bytesCompare = require('bytes-compare')
or
import bytesCompare, { parse, format, compare } from 'bytes-compare'
format
parse
compare
compare(1024, ">=1024KB")
=> true
compare(1024 * 1024, ">=1024MB")
=> true
compare(1024 * 1024 * 1024, ">=1024GB")
=> true