https://github.com/matanlurey/kilobyte
Dart package for size measurements
https://github.com/matanlurey/kilobyte
conversion dart dartlang file-size files size
Last synced: about 1 year ago
JSON representation
Dart package for size measurements
- Host: GitHub
- URL: https://github.com/matanlurey/kilobyte
- Owner: matanlurey
- License: mit
- Created: 2017-05-27T03:41:59.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T02:56:58.000Z (about 2 years ago)
- Last Synced: 2025-04-09T16:21:24.576Z (about 1 year ago)
- Topics: conversion, dart, dartlang, file-size, files, size
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/kilobyte
- Size: 14.6 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Kilobyte
A measurement of payload or footprint, such as `3.12mb`, based on the IEC
standard.
[](https://pub.dev/packages/kilobyte)
[](https://github.com/matanlurey/kilobyte/actions/workflows/check.yaml)
[](https://coveralls.io/github/matanlurey/kilobyte)
## Usage
```dart
import 'package:kilobyte/kilobyte.dart';
void main() {
final size = Size(bytes: 1536);
print(size); // 1.50kb
}
```
## Contributing
Kilobyte is a tiny, focused package. Within that scope, we're happy to accept
contributions. If you have a feature you'd like to see, feel free to
[file an issue](https://github.com/matanlurey/kilobyte/issues/new) or
[fork and open a pull request](https://github.com/matanlurey/kilobyte/fork).
### CI
This package is:
- Formatted with `dart format`.
- Checked with `dart analyze`.
- Tested with `dart test`, including with code coverage.
See [`github/workflows/check.yaml`](./.github/workflows/check.yaml) for details.
### Coverage
To view the coverage report locally (MacOS):
```shell
brew install lcov
dart run coverage:test_with_coverage
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html
```